diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2016-01-05 16:04:32 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2016-01-06 13:07:50 +0000 |
commit | 6e823d283286aab15592f9fde11720c10447c4c5 (patch) | |
tree | 94814624b2b8db1268549422c5aa7d40688c8c77 /src/corelib/io/qprocess_wince.cpp | |
parent | 50ab7c16d470dbb0984bc2b48c5f49d94106edd0 (diff) |
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 <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'src/corelib/io/qprocess_wince.cpp')
-rw-r--r-- | src/corelib/io/qprocess_wince.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
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; } |