util/wrap.pl.in: If the subprocess died with a signal, let's re-signal it
authorRichard Levitte <levitte@openssl.org>
Mon, 22 Aug 2022 16:40:54 +0000 (18:40 +0200)
committerPauli <pauli@openssl.org>
Tue, 23 Aug 2022 23:36:08 +0000 (09:36 +1000)
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 <beldmit@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19042)

(cherry picked from commit bf16ee4f95c31a66e76056c691f25a0d2b4a39c4)

util/wrap.pl.in

index b13c34d8512b3ed4627dc0b8d182135df2084965..de4692f31999e3f301a8843b7dd17872a701d80c 100644 (file)
@@ -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.