aboutsummaryrefslogtreecommitdiff
path: root/libLumina
diff options
context:
space:
mode:
authorKen Moore <moorekou@gmail.com>2015-10-12 08:53:14 -0400
committerKen Moore <moorekou@gmail.com>2015-10-12 08:53:14 -0400
commiteed38ff5c36a4d488a7282b56778a86e7e18a34e (patch)
tree3a18ceafd75830e743f145c10f230f589e9a6577 /libLumina
parentA few more tweaks for the applauncher outlines. Now they are much more readab... (diff)
downloadlumina-eed38ff5c36a4d488a7282b56778a86e7e18a34e.tar.gz
lumina-eed38ff5c36a4d488a7282b56778a86e7e18a34e.tar.bz2
lumina-eed38ff5c36a4d488a7282b56778a86e7e18a34e.zip
Add a process verification check to the LuminaUtils functions for running external utilities. This should catch/break the loop if the external utility stops in some strange way.
Diffstat (limited to 'libLumina')
-rw-r--r--libLumina/LuminaUtils.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libLumina/LuminaUtils.cpp b/libLumina/LuminaUtils.cpp
index 9a09ddf9..27083611 100644
--- a/libLumina/LuminaUtils.cpp
+++ b/libLumina/LuminaUtils.cpp
@@ -38,6 +38,7 @@ int LUtils::runCmd(QString cmd, QStringList args){
}
if(!proc.waitForStarted(30000)){ return 1; } //process never started - max wait of 30 seconds
while(!proc.waitForFinished(300)){
+ if(proc.state() != QProcess::Running){ break; } //somehow missed the finished signal
QCoreApplication::processEvents();
}
int ret = proc.exitCode();
@@ -59,6 +60,7 @@ QStringList LUtils::getCmdOutput(QString cmd, QStringList args){
}
if(!proc.waitForStarted(30000)){ return QStringList(); } //process never started - max wait of 30 seconds
while(!proc.waitForFinished(500)){
+ if(proc.state() != QProcess::Running){ break; } //somehow missed the finished signal
QCoreApplication::processEvents();
}
QStringList out = QString(proc.readAllStandardOutput()).split("\n");
bgstack15