diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-02-18 10:54:58 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2021-02-22 02:47:07 +0000 |
commit | f4e3b073b3d2a50133d734dd604bff21f061a3e6 (patch) | |
tree | f37df81b4a9db6c744fec36dba4bb3383236590f /src | |
parent | 73a04edce151b21ea5d07494603c0317716e99d9 (diff) |
QProcess::startDetached/Unix: fix the resetting of SIGPIPE
This should have been SIG_DFL, as we're about to execute a child
process. It's the child's responsibility to ignore SIGPIPE if it wants
to, or get killed by it when it writes to an pipe with no readers.
Qt itself does this for its own purposes (see qt_ignore_sigpipe() [until
I can get some time to teach Linux about O_NOSIGPIPE]). Therefore, we
ought to reset what we've done.
Change-Id: Ic90d8429a0eb4837971dfffd166585a686790dde
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 1e74cfff60..88cd73b102 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -911,11 +911,7 @@ bool QProcessPrivate::startDetached(qint64 *pid) pid_t childPid = fork(); if (childPid == 0) { - struct sigaction noaction; - memset(&noaction, 0, sizeof(noaction)); - noaction.sa_handler = SIG_IGN; - ::sigaction(SIGPIPE, &noaction, nullptr); - + ::signal(SIGPIPE, SIG_DFL); // reset the signal that we ignored ::setsid(); qt_safe_close(startedPipe[0]); |