summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-10-24 14:21:10 +0000
committerschwarze <schwarze@openbsd.org>2017-10-24 14:21:10 +0000
commitd88e47e1e524ce3793ee7227bc948b10f1f016e8 (patch)
treec1aa7a7119576367b6e7833ca2b76d8083b4e720
parentremove defines for ioctls the kernel doesn't recognise (diff)
downloadwireguard-openbsd-d88e47e1e524ce3793ee7227bc948b10f1f016e8.tar.xz
wireguard-openbsd-d88e47e1e524ce3793ee7227bc948b10f1f016e8.zip
When dd(1) fails because it receives an INT signal,
exit with a non-zero EXIT STATUS, as required by POSIX, consistent with what other operating systems do, consistent with how other OpenBSD programs behave, and making wait(2) consistent with what happens when dd(1) dies from other signals. Patch from <ScottCheloha at gmail dot com>. OK florian@ tb@.
-rw-r--r--bin/dd/misc.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/bin/dd/misc.c b/bin/dd/misc.c
index 5758d25458f..8153971d8f8 100644
--- a/bin/dd/misc.c
+++ b/bin/dd/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.21 2017/08/13 02:06:42 tedu Exp $ */
+/* $OpenBSD: misc.c,v 1.22 2017/10/24 14:21:10 schwarze Exp $ */
/* $NetBSD: misc.c,v 1.4 1995/03/21 09:04:10 cgd Exp $ */
/*-
@@ -111,9 +111,8 @@ summaryx(int notused)
}
void
-terminate(int notused)
+terminate(int signo)
{
-
summary();
- _exit(0);
+ _exit(128 + signo);
}