/* Report a SIGPIPE signal and exit.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008, 2009, 2010 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
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 ();
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);
}
}
}