From bcc80f4e21aeae268a0a1c6d821a72542c7ab628 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 20 Feb 2021 09:43:34 -0800 Subject: QProcess::startDetached/Unix: remove unnecessary ignoring of SIGPIPE This is unnecessary because we can only get SIGPIPE if the reading end of the pipe is closed. And that can only happen if the parent process has exited, meaning there's no one to read our message anyway. Change-Id: Ic90d8429a0eb4837971dfffd1664ec6821993ada Reviewed-by: Oswald Buddenhagen (cherry picked from commit 089bcb007454fe44224139b2d0a0e4145f209b15) --- src/corelib/io/qprocess_unix.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 1e74cfff60..8c6a095844 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -960,22 +960,12 @@ bool QProcessPrivate::startDetached(qint64 *pid) else qt_safe_execv(argv[0], argv); - struct sigaction noaction; - memset(&noaction, 0, sizeof(noaction)); - noaction.sa_handler = SIG_IGN; - ::sigaction(SIGPIPE, &noaction, nullptr); - // '\1' means execv failed char c = '\1'; qt_safe_write(startedPipe[1], &c, 1); qt_safe_close(startedPipe[1]); ::_exit(1); } else if (doubleForkPid == -1) { - struct sigaction noaction; - memset(&noaction, 0, sizeof(noaction)); - noaction.sa_handler = SIG_IGN; - ::sigaction(SIGPIPE, &noaction, nullptr); - // '\2' means internal error char c = '\2'; qt_safe_write(startedPipe[1], &c, 1); -- cgit v1.2.3