X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fsigpipe-die.c;h=43cf870ee1fdf98bd001296ebd42d827fd36bfad;hb=ae006b4;hp=bb3c8b00e6562ba5c37e31c5375abefc1322f871;hpb=ab01b091793316d28722ad1d7e6b869d6ec3911b;p=gnulib.git diff --git a/lib/sigpipe-die.c b/lib/sigpipe-die.c index bb3c8b00e..43cf870ee 100644 --- a/lib/sigpipe-die.c +++ b/lib/sigpipe-die.c @@ -1,5 +1,5 @@ /* Report a SIGPIPE signal and exit. - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ void sigpipe_die (void) { error (exit_failure, 0, "%s", - _("error writing to a closed pipe or socket")); + _("error writing to a closed pipe or socket")); /* Ensure that this function really does not return. */ abort (); @@ -68,15 +68,15 @@ install_sigpipe_die_handler (void (*prepare_die) (void)) sigemptyset (&action.sa_mask); if (sigaction (SIGPIPE, &action, NULL) >= 0) { - /* Unblock the signal (just in case). This is needed because if the - signal was blocked in the parent process, it is also blocked in - this process: the mask of blocked signals is inherited across - fork/exec (except for SIGCHLD). */ - sigset_t sigpipe_set; - - sigemptyset (&sigpipe_set); - sigaddset (&sigpipe_set, SIGPIPE); - sigprocmask (SIG_UNBLOCK, &sigpipe_set, NULL); + /* Unblock the signal (just in case). This is needed because if the + signal was blocked in the parent process, it is also blocked in + this process: the mask of blocked signals is inherited across + fork/exec (except for SIGCHLD). */ + sigset_t sigpipe_set; + + sigemptyset (&sigpipe_set); + sigaddset (&sigpipe_set, SIGPIPE); + sigprocmask (SIG_UNBLOCK, &sigpipe_set, NULL); } } }