From dc267d6dd9ed2bb5d6a405a64e74d71277bbd54c Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 11 May 2009 08:34:08 +0000 Subject: [PATCH] Add some debugging code to QProcess. Reconfigure (python) starts and finishes here (ubuntu9.04) but doesn't proceed and returns this: /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 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/support/Systemcall.cpp b/src/support/Systemcall.cpp index 038448b4f3..22b042448f 100644 --- a/src/support/Systemcall.cpp +++ b/src/support/Systemcall.cpp @@ -13,6 +13,8 @@ #include +#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 -- 2.39.2