diff options
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index fcebc08d7f..ffdf6f9e2e 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -822,19 +822,6 @@ void QProcessPrivate::killProcess() ::kill(pid_t(pid), SIGKILL); } -/* - Returns the difference between msecs and elapsed. If msecs is -1, - however, -1 is returned. -*/ -static int qt_timeout_value(int msecs, int elapsed) -{ - if (msecs == -1) - return -1; - - int timeout = msecs - elapsed; - return timeout < 0 ? 0 : timeout; -} - bool QProcessPrivate::waitForStarted(int msecs) { Q_Q(QProcess); @@ -909,7 +896,7 @@ bool QProcessPrivate::waitForReadyRead(int msecs) if (!stdinChannel.buffer.isEmpty() && stdinChannel.pipe[1] != -1) add_fd(nfds, stdinChannel.pipe[1], &fdwrite); - int timeout = qt_timeout_value(msecs, stopWatch.elapsed()); + int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed()); #ifdef Q_OS_BLACKBERRY int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout); #else @@ -990,7 +977,7 @@ bool QProcessPrivate::waitForBytesWritten(int msecs) if (!stdinChannel.buffer.isEmpty() && stdinChannel.pipe[1] != -1) add_fd(nfds, stdinChannel.pipe[1], &fdwrite); - int timeout = qt_timeout_value(msecs, stopWatch.elapsed()); + int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed()); #ifdef Q_OS_BLACKBERRY int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout); #else @@ -1065,7 +1052,7 @@ bool QProcessPrivate::waitForFinished(int msecs) if (!stdinChannel.buffer.isEmpty() && stdinChannel.pipe[1] != -1) add_fd(nfds, stdinChannel.pipe[1], &fdwrite); - int timeout = qt_timeout_value(msecs, stopWatch.elapsed()); + int timeout = qt_subtract_from_timeout(msecs, stopWatch.elapsed()); #ifdef Q_OS_BLACKBERRY int ret = bb_select(notifiers, nfds + 1, &fdread, &fdwrite, timeout); #else |