mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
Merge pull request #33 from OtacilioNeto/master
Fix 100% CPU usage bug when listing users under FreeBSD.
This commit is contained in:
@@ -40,7 +40,10 @@ QString General::RunCommand(bool &success, QString command, QStringList argument
|
||||
if(arguments.isEmpty()){ proc.start(command); }
|
||||
else{ proc.start(command, arguments); }
|
||||
//Wait for the process to finish (but don't block the event loop)
|
||||
while( !proc.waitForFinished(500) ){ QCoreApplication::processEvents(); }
|
||||
while( !proc.waitForFinished(500) ){
|
||||
if(proc.state() != QProcess::Running){ break; } //somehow missed the finished signal
|
||||
QCoreApplication::processEvents();
|
||||
}
|
||||
success = (proc.exitCode()==0); //return success/failure
|
||||
return QString(proc.readAllStandardOutput());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user