summaryrefslogtreecommitdiff
path: root/util/wrap.pl.in
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2022-08-22 18:40:54 +0200
committerPauli <pauli@openssl.org>2022-08-24 09:35:39 +1000
commitbf16ee4f95c31a66e76056c691f25a0d2b4a39c4 (patch)
tree6b82c328c96294448d3988f083174dc0fa13f55c /util/wrap.pl.in
parente921882d57201e14cc6a48765b2281065d6f5c65 (diff)
downloadopenssl-new-bf16ee4f95c31a66e76056c691f25a0d2b4a39c4.tar.gz
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 <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)
Diffstat (limited to 'util/wrap.pl.in')
-rw-r--r--util/wrap.pl.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/wrap.pl.in b/util/wrap.pl.in
index b13c34d851..de4692f319 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.