summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qprocess.cpp
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2020-12-08 20:42:34 +0200
committerOswald Buddenhagen <oswald.buddenhagen@gmx.de>2020-12-09 11:48:36 +0000
commitdccc2aff6cb0bc480c6272536f595936e4ebc31d (patch)
treed44b0b9cd7f85b19b02db1bcaf83a0d4f247d408 /src/corelib/io/qprocess.cpp
parentddc585b7c773786045f3658d7da5425ed2f2f786 (diff)
QProcess/Unix: unify waiting in 'Starting' state
It makes no sense to poll the I/O pipes if we didn't get a start-up notification yet. And in fact, all waitFor...() functions except waitForReadyRead() did already explicitly wait for process startup completion. So fix that one up, and remove the handling of 'Starting' state from the I/O loops. Change-Id: Ibb7eb7c768bef3f9b6c54009c73b91775570102c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src/corelib/io/qprocess.cpp')
-rw-r--r--src/corelib/io/qprocess.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 1583f31e34..fb769ef74c 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1783,7 +1783,15 @@ bool QProcess::waitForReadyRead(int msecs)
return false;
if (d->currentReadChannel == QProcess::StandardError && d->stderrChannel.closed)
return false;
- return d->waitForReadyRead(QDeadlineTimer(msecs));
+
+ QDeadlineTimer deadline(msecs);
+ if (d->processState == QProcess::Starting) {
+ bool started = d->waitForStarted(deadline);
+ if (!started)
+ return false;
+ }
+
+ return d->waitForReadyRead(deadline);
}
/*! \reimp