diff options
author | Colin Watson <cjwatson@debian.org> | 2010-02-08 04:57:30 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2010-02-08 04:57:30 +0000 |
commit | d175433b8aae33c57ba8756b31e6abff2a899f29 (patch) | |
tree | e539fd3deccca29e89a8f6b2900051399b41d1ab /src | |
parent | e06b0ffa961509080474669ace5f589131b82ea6 (diff) |
* src/man.c (format_display_and_save): Use sigaction, not signal.
Diffstat (limited to 'src')
-rw-r--r-- | src/man.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -2108,7 +2108,13 @@ static int format_display_and_save (pipeline *decomp, { pipeline *sav_p = open_cat_stream (cat_file); int instat; - RETSIGTYPE (*old_handler)(int) = signal (SIGPIPE, SIG_IGN); + struct sigaction sa, osa_sigpipe; + + memset (&sa, 0, sizeof sa); + sa.sa_handler = SIG_IGN; + sigemptyset (&sa.sa_mask); + sa.sa_flags = 0; + sigaction (SIGPIPE, &sa, &osa_sigpipe); if (global_manpath) drop_effective_privs (); @@ -2132,7 +2138,7 @@ static int format_display_and_save (pipeline *decomp, if (sav_p) close_cat_stream (sav_p, cat_file, instat); pipeline_wait (disp_cmd); - signal (SIGPIPE, old_handler); + sigaction (SIGPIPE, &osa_sigpipe, NULL); return instat; } #endif /* MAN_CATS */ |