diff options
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index cf9d38097a..15752f84b2 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -762,6 +762,10 @@ bool QProcessPrivate::waitForReadyRead(int msecs) if (qt_pollfd_check(poller.stdinPipe(), POLLOUT)) _q_canWrite(); + // Signals triggered by I/O may have stopped this process: + if (processState == QProcess::NotRunning) + return false; + if (qt_pollfd_check(poller.forkfd(), POLLIN)) { if (_q_processDied()) return false; @@ -808,6 +812,10 @@ bool QProcessPrivate::waitForBytesWritten(int msecs) if (qt_pollfd_check(poller.stderrPipe(), POLLIN)) _q_canReadStandardError(); + // Signals triggered by I/O may have stopped this process: + if (processState == QProcess::NotRunning) + return false; + if (qt_pollfd_check(poller.forkfd(), POLLIN)) { if (_q_processDied()) return false; @@ -853,6 +861,10 @@ bool QProcessPrivate::waitForFinished(int msecs) if (qt_pollfd_check(poller.stderrPipe(), POLLIN)) _q_canReadStandardError(); + // Signals triggered by I/O may have stopped this process: + if (processState == QProcess::NotRunning) + return true; + if (qt_pollfd_check(poller.forkfd(), POLLIN)) { if (_q_processDied()) return true; |