diff options
-rw-r--r-- | docs/ChangeLog | 6 | ||||
-rw-r--r-- | docs/NEWS | 2 | ||||
-rw-r--r-- | lib/pipeline.c | 9 |
3 files changed, 17 insertions, 0 deletions
diff --git a/docs/ChangeLog b/docs/ChangeLog index bb2ee5ad..c9d354b3 100644 --- a/docs/ChangeLog +++ b/docs/ChangeLog @@ -1,3 +1,9 @@ +Sun Sep 17 09:20:33 BST 2006 Colin Watson <cjwatson@debian.org> + + * lib/pipeline.c (pipeline_start): Ignore SIGPIPE in child processes + (Debian bug #387864). + * docs/NEWS: Document this. + Thu Aug 10 17:23:03 BST 2006 Colin Watson <cjwatson@debian.org> * src/encodings.c (get_default_device): Always use utf8 if preconv @@ -9,6 +9,8 @@ Major changes since man-db 2.4.3: o Ignore SIGINT and SIGQUIT while running subprocesses, so that typing Ctrl-C doesn't kill less (broken in 2.4.3). + o Similarly, ignore SIGPIPE in subprocesses. + o Skip "exec" in configuration file commands (perhaps left over from old installations), which the pipeline execution library cannot handle directly. 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, |