summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-03-31 10:03:31 +0200
committerLiang Qi <liang.qi@theqtcompany.com>2015-03-31 10:03:31 +0200
commitce9519593a0b3deb99d1dd2529770f7e9fffef92 (patch)
treec9bca05230dd68f49494240ae930bad1fe0c5956 /src/corelib/io/qprocess_unix.cpp
parent509f77cca28aa3edea5523c5869bae4412ed2ccc (diff)
parent7baaec17edb06634f1d6235a55c7adbd112cba3e (diff)
Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r--src/corelib/io/qprocess_unix.cpp19
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