From 1c79b94a6c6e7ca1a852ee9bb44eefafd033eaa1 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 Change-Id: Icfe44ecf285a480fafe4fffd174d0fa4701b0076 Reviewed-by: Oswald Buddenhagen Reviewed-by: Fabian Kosmale (cherry picked from commit 956b2495285251e4840ec32885ffa2cfbb7bd79c) Reviewed-by: Qt Cherry-pick Bot --- 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 449fd14c5c2..98a716192e2 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; }