diff options
author | Jim Meyering <jim@meyering.net> | 1996-10-29 04:16:59 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-10-29 04:16:59 +0000 |
commit | 84b8cf9fcf25a4e288841f690879a898417b7d99 (patch) | |
tree | c3f24ab8f6ec0db90f3ee00d4cd577886e7dd496 /src | |
parent | c673119b0bd614641831b7b8540dc0447f293d5f (diff) | |
download | coreutils-84b8cf9fcf25a4e288841f690879a898417b7d99.tar.xz |
(main): Ignore SIGPIPE.
Diffstat (limited to 'src')
-rw-r--r-- | src/tee.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -135,6 +135,21 @@ main (int argc, char **argv) #endif /* _POSIX_SOURCE */ } + /* 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 + errs = tee (argc - optind, (const char **) &argv[optind]); if (close (0) != 0) error (1, errno, _("standard input")); |