From 6e823d283286aab15592f9fde11720c10447c4c5 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 5 Jan 2016 16:04:32 +0100 Subject: WinCE: Remove QIncrementalSleepTimer from QProcess::waitForFinished Remove a superfluous loop and thus the usage of QIncrementalSleepTimer from QProcess::waitForFinished. We just wait for the process handle. There's no need for a loop that checks multiple wait conditions. This enables us to remove QWindowsPipeWriter from the Windows CE port in a subsequent commit. Change-Id: If6a82405227cf145263dba3726bae959e6871d0e Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess_wince.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qprocess_wince.cpp b/src/corelib/io/qprocess_wince.cpp index 9b63ece15c..acacdb8540 100644 --- a/src/corelib/io/qprocess_wince.cpp +++ b/src/corelib/io/qprocess_wince.cpp @@ -235,20 +235,14 @@ bool QProcessPrivate::waitForFinished(int msecs) qDebug("QProcessPrivate::waitForFinished(%d)", msecs); #endif - QIncrementalSleepTimer timer(msecs); - - forever { - if (!pid) - return true; - - if (WaitForSingleObject(pid->hProcess, timer.nextSleepTime()) == WAIT_OBJECT_0) { - _q_processDied(); - return true; - } + if (!pid) + return true; - if (timer.hasTimedOut()) - break; + if (WaitForSingleObject(pid->hProcess, msecs == -1 ? INFINITE : msecs) == WAIT_OBJECT_0) { + _q_processDied(); + return true; } + setError(QProcess::Timedout); return false; } -- cgit v1.2.3