@@ -68,15 +68,15 @@ void WorkThread::runCount()
6868 QString cmd = QString (" badblocks -sv -c %1 -b %2 %3 %4 %5" ).arg (m_checkConut).arg (DEFAULT_BLOCK_SIZE).arg (m_devicePath).arg (j).arg (i);
6969
7070 QDateTime ctime = QDateTime::currentDateTime ();
71- QString output , error;
72- int exitcode = Utils::executCmd (cmd, output , error);
71+ QString stdErr , error;
72+ int exitcode = Utils::executCmd (cmd, NULL , &stdErr , error);
7373 if (exitcode != 0 ) {
7474 qDebug () << " Failed to execute badblocks command, error:" << error;
7575 return ;
7676 }
7777 QDateTime ctime1 = QDateTime::currentDateTime ();
7878
79- if (output .indexOf (" 0/0/0" ) != -1 ) {
79+ if (stdErr .indexOf (" 0/0/0" ) != -1 ) {
8080 // qDebug() << "Block" << i << "is good";
8181 QString cylinderNumber = QString (" %1" ).arg (i);
8282 QString cylinderTimeConsuming = QString (" %1" ).arg (ctime.msecsTo (ctime1));
@@ -116,8 +116,8 @@ void WorkThread::runTime()
116116 QString cmd = QString (" badblocks -sv -b %1 %2 %3 %4" ).arg (DEFAULT_BLOCK_SIZE).arg (m_devicePath).arg (j).arg (i);
117117
118118 QDateTime ctime = QDateTime::currentDateTime ();
119- QString output , error;
120- int exitcode = Utils::executCmd (cmd, output , error);
119+ QString stdErr , error;
120+ int exitcode = Utils::executCmd (cmd, NULL , &stdErr , error);
121121 if (exitcode != 0 ) {
122122 qDebug () << " Failed to execute badblocks command, error:" << error;
123123 return ;
@@ -133,7 +133,7 @@ void WorkThread::runTime()
133133
134134 emit checkBadBlocksInfo (cylinderNumber, cylinderTimeConsuming, cylinderStatus, cylinderErrorInfo);
135135 } else {
136- if (output .indexOf (" 0/0/0" ) != -1 ) {
136+ if (stdErr .indexOf (" 0/0/0" ) != -1 ) {
137137 // qDebug() << "Block" << i << "is good";
138138 QString cylinderNumber = QString (" %1" ).arg (i);
139139 QString cylinderTimeConsuming = QString (" %1" ).arg (ctime.msecsTo (ctime1));
@@ -188,15 +188,15 @@ void FixThread::runFix()
188188 QString cmd = QString (" badblocks -sv -b %1 -w %2 %3 %4" ).arg (m_checkSize).arg (m_devicePath).arg (k).arg (j);
189189
190190 QDateTime ctime = QDateTime::currentDateTime ();
191- QString output , error;
192- int exitcode = Utils::executCmd (cmd, output , error);
191+ QString stdErr , error;
192+ int exitcode = Utils::executCmd (cmd, NULL , &stdErr , error);
193193 if (exitcode != 0 ) {
194194 qDebug () << " Failed to execute badblocks command, error:" << error;
195195 return ;
196196 }
197197 QDateTime ctime1 = QDateTime::currentDateTime ();
198198
199- if (output .indexOf (" 0/0/0" ) != -1 ) {
199+ if (stdErr .indexOf (" 0/0/0" ) != -1 ) {
200200 // qDebug() << "Fixed block" << j << "successfully";
201201 QString cylinderNumber = QString (" %1" ).arg (j);
202202 QString cylinderStatus = " good" ;
0 commit comments