summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r--src/corelib/io/qprocess_unix.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp
index 6b7f187fee..318c633017 100644
--- a/src/corelib/io/qprocess_unix.cpp
+++ b/src/corelib/io/qprocess_unix.cpp
@@ -792,6 +792,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;
@@ -838,6 +842,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;
@@ -883,6 +891,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;