mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(main) [!defined _POSIX_SOURCE]:
Use simpler "signal (sig, SIG_DFL)" rather than sigaction equivalent.
This commit is contained in:
1 parent
7b6892c3df
commit
d432ccecc8
1 file changed
+1
-23
@@ -115,33 +115,11 @@ main (int argc, char **argv)
|
||||
}
|
||||
|
||||
if (ignore_interrupts)
|
||||
{
|
||||
#ifdef _POSIX_SOURCE
|
||||
struct sigaction sigact;
|
||||
|
||||
sigact.sa_handler = SIG_IGN;
|
||||
sigemptyset (&sigact.sa_mask);
|
||||
sigact.sa_flags = 0;
|
||||
sigaction (SIGINT, &sigact, NULL);
|
||||
#else /* !_POSIX_SOURCE */
|
||||
signal (SIGINT, SIG_IGN);
|
||||
#endif /* _POSIX_SOURCE */
|
||||
}
|
||||
signal (SIGINT, SIG_IGN);
|
||||
|
||||
/* Don't let us be killed if one of the output files is a pipe that
|
||||
doesn't consume all its input. */
|
||||
#ifdef _POSIX_SOURCE
|
||||
{
|
||||
struct sigaction sigact;
|
||||
|
||||
sigact.sa_handler = SIG_IGN;
|
||||
sigemptyset (&sigact.sa_mask);
|
||||
sigact.sa_flags = 0;
|
||||
sigaction (SIGPIPE, &sigact, NULL);
|
||||
}
|
||||
#else
|
||||
signal (SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
|
||||
/* Do *not* warn if tee is given no file arguments.
|
||||
POSIX requires that it work when given no arguments. */
|
||||
|
||||
Reference in new issue
Block a user