From 956b2495285251e4840ec32885ffa2cfbb7bd79c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 16 Mar 2023 18:10:34 -0700 Subject: [PATCH] QProcess/Unix: don't overwrite openChannels() error message Pick-to: 6.5 Change-Id: Icfe44ecf285a480fafe4fffd174d0fa4701b0076 Reviewed-by: Oswald Buddenhagen Reviewed-by: Fabian Kosmale --- src/corelib/io/qprocess_unix.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 24c5ebc6d2c..9fbf869455c 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -421,8 +421,12 @@ void QProcessPrivate::startProcess() #endif // Initialize pipes - if (!openChannels() || qt_create_pipe(childStartedPipe) != 0) { - setErrorAndEmit(QProcess::FailedToStart, qt_error_string(errno)); + if (!openChannels()) { + // openChannel sets the error string + return; + } + if (qt_create_pipe(childStartedPipe) != 0) { + setErrorAndEmit(QProcess::FailedToStart, "pipe: "_L1 + qt_error_string(errno)); cleanup(); return; }