summaryrefslogtreecommitdiff
path: root/src/dd.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1994-07-03 17:46:37 +0000
committerJim Meyering <jim@meyering.net>1994-07-03 17:46:37 +0000
commit792d894bd907cb2538dab605270a84e073f76984 (patch)
tree6287a820dd6c17d61cf8b1cdb49d6a209b399a04 /src/dd.c
parent363b712c93b718987517dcaac58a850ade801165 (diff)
downloadcoreutils-792d894bd907cb2538dab605270a84e073f76984.tar.xz
.
Diffstat (limited to 'src/dd.c')
-rw-r--r--src/dd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/dd.c b/src/dd.c
index 68f55307e..8f93cbbc2 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -405,9 +405,19 @@ main (argc, argv)
sigact.sa_flags = 0;
sigaction (SIGINT, &sigact, NULL);
}
+ sigaction (SIGPIPE, NULL, &sigact);
+ if (sigact.sa_handler != SIG_IGN)
+ {
+ sigact.sa_handler = interrupt_handler;
+ sigemptyset (&sigact.sa_mask);
+ sigact.sa_flags = 0;
+ sigaction (SIGPIPE, &sigact, NULL);
+ }
#else /* !_POSIX_VERSION */
if (signal (SIGINT, SIG_IGN) != SIG_IGN)
signal (SIGINT, interrupt_handler);
+ if (signal (SIGPIPE, SIG_IGN) != SIG_IGN)
+ signal (SIGPIPE, interrupt_handler);
#endif /* !_POSIX_VERSION */
copy ();
}