Skip to content

Commit

Permalink
util/wrap.pl.in: If the subprocess died with a signal, let's re-signa…
Browse files Browse the repository at this point in the history
…l 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 #19042)

(cherry picked from commit bf16ee4)
  • Loading branch information
levitte authored and paulidale committed Aug 23, 2022
1 parent 25c4867 commit 41f238d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/wrap.pl.in
Expand Up @@ -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.
Expand Down

0 comments on commit 41f238d

Please sign in to comment.