From 103f4a1f281be78af1ae6e8f27444e428927763a Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 24 Oct 2017 14:21:11 +0000 Subject: 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 . OK florian@ tb@. --- bin/dd/misc.c | 7 +++---- 1 file 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); } -- cgit v1.2.3