diff options
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 3c6d294916..4076ec5855 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -1107,7 +1107,7 @@ bool QProcessPrivate::waitForStarted(int msecs) #if defined (QPROCESS_DEBUG) qDebug("QProcessPrivate::waitForStarted(%d) waiting for child to start (fd = %d)", msecs, - childStartedPipe[0]); + childStartedPipe[0]); #endif fd_set fds; @@ -1172,32 +1172,32 @@ bool QProcessPrivate::waitForReadyRead(int msecs) if (ret == 0) { processError = QProcess::Timedout; q->setErrorString(QProcess::tr("Process operation timed out")); - return false; - } + return false; + } - if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { + if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { if (!_q_startupNotification()) return false; - } + } bool readyReadEmitted = false; - if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) { - bool canRead = _q_canReadStandardOutput(); + if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) { + bool canRead = _q_canReadStandardOutput(); if (processChannel == QProcess::StandardOutput && canRead) readyReadEmitted = true; - } - if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) { - bool canRead = _q_canReadStandardError(); + } + if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) { + bool canRead = _q_canReadStandardError(); if (processChannel == QProcess::StandardError && canRead) readyReadEmitted = true; - } + } if (readyReadEmitted) return true; - if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) - _q_canWrite(); + if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) + _q_canWrite(); - if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { + if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { if (_q_processDied()) return false; } @@ -1248,26 +1248,26 @@ bool QProcessPrivate::waitForBytesWritten(int msecs) } if (ret == 0) { - processError = QProcess::Timedout; - q->setErrorString(QProcess::tr("Process operation timed out")); - return false; - } + processError = QProcess::Timedout; + q->setErrorString(QProcess::tr("Process operation timed out")); + return false; + } - if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { - if (!_q_startupNotification()) - return false; - } + if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { + if (!_q_startupNotification()) + return false; + } - if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) - return _q_canWrite(); + if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) + return _q_canWrite(); - if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) - _q_canReadStandardOutput(); + if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) + _q_canReadStandardOutput(); - if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) - _q_canReadStandardError(); + if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) + _q_canReadStandardError(); - if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { + if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { if (_q_processDied()) return false; } @@ -1317,29 +1317,29 @@ bool QProcessPrivate::waitForFinished(int msecs) if (ret < 0) { break; } - if (ret == 0) { - processError = QProcess::Timedout; - q->setErrorString(QProcess::tr("Process operation timed out")); - return false; - } - - if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { - if (!_q_startupNotification()) - return false; - } - if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) - _q_canWrite(); - - if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) - _q_canReadStandardOutput(); - - if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) - _q_canReadStandardError(); - - if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { + if (ret == 0) { + processError = QProcess::Timedout; + q->setErrorString(QProcess::tr("Process operation timed out")); + return false; + } + + if (childStartedPipe[0] != -1 && FD_ISSET(childStartedPipe[0], &fdread)) { + if (!_q_startupNotification()) + return false; + } + if (stdinChannel.pipe[1] != -1 && FD_ISSET(stdinChannel.pipe[1], &fdwrite)) + _q_canWrite(); + + if (stdoutChannel.pipe[0] != -1 && FD_ISSET(stdoutChannel.pipe[0], &fdread)) + _q_canReadStandardOutput(); + + if (stderrChannel.pipe[0] != -1 && FD_ISSET(stderrChannel.pipe[0], &fdread)) + _q_canReadStandardError(); + + if (deathPipe[0] == -1 || FD_ISSET(deathPipe[0], &fdread)) { if (_q_processDied()) return true; - } + } } return false; } |