Make OpenSSL::Test::run() sensitive to signals
authorRichard Levitte <levitte@openssl.org>
Fri, 18 Mar 2016 07:57:52 +0000 (08:57 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 18 Mar 2016 14:25:23 +0000 (15:25 +0100)
commit2ef157afb9254d043b0f8e0909c7f050bb5389a5
tree2a855d4b6c7d8d5a695b385dbfbe8cc0fb863715
parent71cdcfc6069ca8afe92cda636805a8c46f000862
Make OpenSSL::Test::run() sensitive to signals

$? in perl gets the status value from wait(2), which is a word with
the exit code in the upper half and the number of a raised signal in
the lower half.  OpenSSL::Test::run() ignored the signal half up until
now.

With this change, we recalculate an exit code the same way the Unix
shells do, using this formula:

    ($? & 0x7f) ? ($? & 0x7f)|0x80 : ($? >> 8);

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Emilia Käsper <emilia@openssl.org>
test/testlib/OpenSSL/Test.pm