diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index 8b29a8964f7..e7d671abc84 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1057,15 +1057,14 @@ bool QProcessPrivate::_q_canWrite() /*! \internal */ -bool QProcessPrivate::_q_processDied() +void QProcessPrivate::_q_processDied() { Q_Q(QProcess); #if defined QPROCESS_DEBUG qDebug("QProcessPrivate::_q_processDied()"); #endif #ifdef Q_OS_UNIX - if (!waitForDeadChild()) - return false; + waitForDeadChild(); #endif #ifdef Q_OS_WIN if (processFinishedNotifier) @@ -1078,7 +1077,7 @@ bool QProcessPrivate::_q_processDied() // give it a chance to emit started() or errorOccurred(FailedToStart). if (processState == QProcess::Starting) { if (!_q_startupNotification()) - return true; + return; } if (dying) { @@ -1086,7 +1085,7 @@ bool QProcessPrivate::_q_processDied() // reentering this slot recursively by calling waitForFinished() // or opening a dialog inside slots connected to the readyRead // signals emitted below. - return true; + return; } dying = true; @@ -1119,7 +1118,6 @@ bool QProcessPrivate::_q_processDied() #if defined QPROCESS_DEBUG qDebug("QProcessPrivate::_q_processDied() process is dead"); #endif - return true; } /*! diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h index cfa86c8508b..86c778d5116 100644 --- a/src/corelib/io/qprocess.h +++ b/src/corelib/io/qprocess.h @@ -283,7 +283,7 @@ private: Q_PRIVATE_SLOT(d_func(), bool _q_canReadStandardError()) Q_PRIVATE_SLOT(d_func(), bool _q_canWrite()) Q_PRIVATE_SLOT(d_func(), bool _q_startupNotification()) - Q_PRIVATE_SLOT(d_func(), bool _q_processDied()) + Q_PRIVATE_SLOT(d_func(), void _q_processDied()) friend class QProcessManager; }; diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h index 1f449bd4c86..decd6c98f5e 100644 --- a/src/corelib/io/qprocess_p.h +++ b/src/corelib/io/qprocess_p.h @@ -295,7 +295,7 @@ public: bool _q_canReadStandardError(); bool _q_canWrite(); bool _q_startupNotification(); - bool _q_processDied(); + void _q_processDied(); QProcess::ProcessChannelMode processChannelMode = QProcess::SeparateChannels; QProcess::InputChannelMode inputChannelMode = QProcess::ManagedInputChannel; @@ -354,7 +354,7 @@ public: void killProcess(); void findExitCode(); #ifdef Q_OS_UNIX - bool waitForDeadChild(); + void waitForDeadChild(); #endif #ifdef Q_OS_WIN bool callCreateProcess(QProcess::CreateProcessArguments *cpargs); diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 9e5b26b3d6d..437d2872dd3 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -768,8 +768,8 @@ bool QProcessPrivate::waitForReadyRead(int msecs) return false; if (qt_pollfd_check(poller.forkfd(), POLLIN)) { - if (_q_processDied()) - return false; + _q_processDied(); + return false; } } return false; @@ -818,8 +818,8 @@ bool QProcessPrivate::waitForBytesWritten(int msecs) return false; if (qt_pollfd_check(poller.forkfd(), POLLIN)) { - if (_q_processDied()) - return false; + _q_processDied(); + return false; } } @@ -867,8 +867,8 @@ bool QProcessPrivate::waitForFinished(int msecs) return true; if (qt_pollfd_check(poller.forkfd(), POLLIN)) { - if (_q_processDied()) - return true; + _q_processDied(); + return true; } } return false; @@ -878,10 +878,10 @@ void QProcessPrivate::findExitCode() { } -bool QProcessPrivate::waitForDeadChild() +void QProcessPrivate::waitForDeadChild() { if (forkfd == -1) - return true; // child has already exited + return; // child has already been reaped // read the process information from our fd forkfd_info info; @@ -901,7 +901,6 @@ bool QProcessPrivate::waitForDeadChild() qDebug() << "QProcessPrivate::waitForDeadChild() dead with exitCode" << exitCode << ", crashed?" << crashed; #endif - return true; } bool QProcessPrivate::startDetached(qint64 *pid)