diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2017-10-24 14:21:11 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2017-10-24 14:21:11 +0000 |
commit | 103f4a1f281be78af1ae6e8f27444e428927763a (patch) | |
tree | 9c1e78d96c546195d500f31bb96eb238b645abdf | |
parent | 8051b6fbb7b6f9b7a3927a285a2d49f4ee6a064a (diff) |
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.c | 7 |
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); } |