summaryrefslogtreecommitdiff
path: root/src/dd.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2000-01-18 07:28:47 +0000
committerJim Meyering <jim@meyering.net>2000-01-18 07:28:47 +0000
commit8024f33e45a2ba3b47f3a1362711a86bd19f57da (patch)
tree81e554a0962b06211ace5819f417f6cbb9695da0 /src/dd.c
parent1fe0bff2f4596de38dfcb8f3acc0b981d709c976 (diff)
downloadcoreutils-8024f33e45a2ba3b47f3a1362711a86bd19f57da.tar.xz
(interrupt_handler):
Don't use SA_INTERRUPT to decide whether to call sigaction, as POSIX.1 doesn't require SA_INTERRUPT and some systems (e.g. Solaris 7) don't define it. Use SA_NOCLDSTOP instead; it's been part of POSIX.1 since day 1 (in 1988). (install_handler): Use SA_NOCLDSTOP, not _POSIX_VERSION, to decide whether to call sigaction; this fixes an old typo.
Diffstat (limited to 'src/dd.c')
-rw-r--r--src/dd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dd.c b/src/dd.c
index 4bb46c6c9..f2b8a63cb 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -1,5 +1,5 @@
/* dd -- convert a file while copying it.
- Copyright (C) 85, 90, 91, 1995-1999 Free Software Foundation, Inc.
+ Copyright (C) 85, 90, 91, 1995-2000 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
@@ -381,16 +381,16 @@ quit (int code)
static RETSIGTYPE
interrupt_handler (int sig)
{
-#ifdef SA_INTERRUPT
+#ifdef SA_NOCLDSTOP
struct sigaction sigact;
sigact.sa_handler = SIG_DFL;
sigemptyset (&sigact.sa_mask);
sigact.sa_flags = 0;
sigaction (sig, &sigact, NULL);
-#else /* !SA_INTERRUPT */
+#else
signal (sig, SIG_DFL);
-#endif /* SA_INTERRUPT */
+#endif
cleanup ();
kill (getpid (), sig);
}
@@ -406,7 +406,7 @@ siginfo_handler (int sig ATTRIBUTE_UNUSED)
static void
install_handler (int sig_num, RETSIGTYPE (*sig_handler) (int sig))
{
-#ifdef _POSIX_VERSION
+#ifdef SA_NOCLDSTOP
struct sigaction sigact;
sigaction (sig_num, NULL, &sigact);
if (sigact.sa_handler != SIG_IGN)