From db1c238a66e3b7ae16768a4e01ce46a51a51eba3 Mon Sep 17 00:00:00 2001 From: Alex Trotsenko Date: Sat, 27 Mar 2021 15:45:45 +0200 Subject: [PATCH] QProcess/Win: do not use extended API for polling We avoid entering an alertable wait state there, so calling WaitForSingleObject() instead of the ...Ex() analog would be appropriate. Change-Id: I7cd23805519f18b3174f66537dcf4c0da5061ca0 Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qprocess_win.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 7c261e7558..d0e57b51fa 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -718,7 +718,8 @@ bool QProcessPrivate::waitForReadyRead(const QDeadlineTimer &deadline) if (!pid) return false; - if (WaitForSingleObjectEx(pid->hProcess, 0, false) == WAIT_OBJECT_0) { + + if (WaitForSingleObject(pid->hProcess, 0) == WAIT_OBJECT_0) { bool readyReadEmitted = drainOutputPipes(); if (pid) processFinished(); @@ -762,9 +763,8 @@ bool QProcessPrivate::waitForBytesWritten(const QDeadlineTimer &deadline) if (!pid) return false; - // Wait for the process to signal any change in its state, - // such as incoming data, or if the process died. - if (WaitForSingleObjectEx(pid->hProcess, 0, false) == WAIT_OBJECT_0) { + // Check if the process is signaling completion. + if (WaitForSingleObject(pid->hProcess, 0) == WAIT_OBJECT_0) { drainOutputPipes(); if (pid) processFinished();