summaryrefslogtreecommitdiff
path: root/lib/pipeline.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pipeline.c')
-rw-r--r--lib/pipeline.c9
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,