diff options
author | Colin Watson <cjwatson@debian.org> | 2006-09-17 08:20:39 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2006-09-17 08:20:39 +0000 |
commit | de4e3f7503f9e93d1e43165fd41c0307a32bb4d4 (patch) | |
tree | 6d9576413c948f7ef6825dfdd5652c51223c9c49 /lib/pipeline.c | |
parent | f9e1014c09fd219e2bf7dcc09278104e8a05116e (diff) |
* lib/pipeline.c (pipeline_start): Ignore SIGPIPE in child processes
(Debian bug #387864).
* docs/NEWS: Document this.
Diffstat (limited to 'lib/pipeline.c')
-rw-r--r-- | lib/pipeline.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/pipeline.c b/lib/pipeline.c index f734d77a..3411afbb 100644 --- a/lib/pipeline.c +++ b/lib/pipeline.c @@ -639,6 +639,8 @@ void pipeline_start (pipeline *p) if (pid < 0) error (FATAL, errno, _("fork failed")); if (pid == 0) { + struct sigaction sa; + /* child */ pop_all_cleanups (); @@ -685,6 +687,13 @@ void pipeline_start (pipeline *p) while (sigaction (SIGQUIT, &osa_sigquit, NULL) && errno == EINTR) ; + /* ... but we don't want to know about SIGPIPE. */ + sa.sa_handler = SIG_IGN; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + while (sigaction (SIGPIPE, &sa, NULL) && + errno == EINTR) + ; execvp (p->commands[i]->name, p->commands[i]->argv); error (EXEC_FAILED_EXIT_STATUS, errno, |