]> git.lyx.org Git - features.git/commitdiff
Add some debugging code to QProcess. Reconfigure (python) starts and finishes here...
authorAbdelrazak Younes <younes@lyx.org>
Mon, 11 May 2009 08:34:08 +0000 (08:34 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 11 May 2009 08:34:08 +0000 (08:34 +0000)
/home/younes/devel/lyx/trunk/src/support/Systemcall.cpp(66): Qprocess python -tt '/home/younes/devel/lyx/trunk/lib/configure.py' --with-version-suffix=2.0 finished!
/home/younes/devel/lyx/trunk/src/support/Systemcall.cpp(67): exitCode 2
/home/younes/devel/lyx/trunk/src/support/Systemcall.cpp(68): error 5
/home/younes/devel/lyx/trunk/src/support/Systemcall.cpp(69): state 0
/home/younes/devel/lyx/trunk/src/support/Systemcall.cpp(70): status 0

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29625 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/Systemcall.cpp

index 038448b4f3d860e16ea54d9aac15105bee91dff0..22b042448f7b1cf3dc9f68522f0348327cf727f2 100644 (file)
@@ -13,6 +13,8 @@
 
 #include <config.h>
 
+#include "support/debug.h"
+#include "support/qstring_helpers.h"
 #include "support/Systemcall.h"
 #include "support/os.h"
 
@@ -46,7 +48,27 @@ int Systemcall::startscript(Starttype how, string const & what)
        QString cmd = QString::fromLocal8Bit(command.c_str());
        QProcess process;
        process.start(cmd);
-       process.waitForFinished();
+       if (!process.waitForStarted(1000)) {
+               LYXERR0("Qprocess " << cmd << " did not start!");
+               LYXERR0("error " << process.error());
+               LYXERR0("state " << process.state());
+               LYXERR0("status " << process.exitStatus());
+               return 10;
+       }
+       if (!process.waitForFinished(30000)) {
+               LYXERR0("Qprocess " << cmd << " did not finished!");
+               LYXERR0("error " << process.error());
+               LYXERR0("state " << process.state());
+               LYXERR0("status " << process.exitStatus());
+               return 20;
+       }
+       if (process.exitCode()) {
+               LYXERR0("Qprocess " << cmd << " finished!");
+               LYXERR0("exitCode " << process.exitCode());
+               LYXERR0("error " << process.error());
+               LYXERR0("state " << process.state());
+               LYXERR0("status " << process.exitStatus());
+       }
        return process.exitCode();
 #endif