From: Richard Levitte Date: Mon, 22 Aug 2022 16:40:54 +0000 (+0200) Subject: util/wrap.pl.in: If the subprocess died with a signal, let's re-signal it X-Git-Tag: openssl-3.2.0-alpha1~2170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf16ee4f95c31a66e76056c691f25a0d2b4a39c4;p=thirdparty%2Fopenssl.git util/wrap.pl.in: If the subprocess died with a signal, let's re-signal it A simple 'kill' of the same signal on our own process should do it. This will allow the shell that this is running under to catch it properly, and output something if it usually does that. Fixes #19041 Reviewed-by: Dmitry Belyavskiy Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/19042) --- diff --git a/util/wrap.pl.in b/util/wrap.pl.in index b13c34d8512..de4692f3199 100644 --- a/util/wrap.pl.in +++ b/util/wrap.pl.in @@ -68,7 +68,10 @@ my $waitcode = system @cmd; die "wrap.pl: Failed to execute '", join(' ', @cmd), "': $!\n" if $waitcode == -1; -# When the subprocess aborted on a signal, mimic what Unix shells do, by +# When the subprocess aborted on a signal, we simply raise the same signal. +kill ($? & 255) => $$ if ($? & 255) != 0; + +# If that didn't stop this script, mimic what Unix shells do, by # converting the signal code to an exit code by setting the high bit. # This only happens on Unix flavored operating systems, the others don't # have this sort of signaling to date, and simply leave the low byte zero.