diff options
Diffstat (limited to 'selftest')
-rwxr-xr-x | selftest/selftest.pl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl index d8640e0d1a..213954cfbf 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -959,6 +959,17 @@ $envvarstr $cmd =~ s/\$LISTOPT/--list/; system($cmd); + + if ($? == -1) { + die("Unable to run $cmd: $!"); + } elsif ($? & 127) { + die(snprintf("%s died with signal %d, %s coredump\n", $cmd, ($? & 127), ($? & 128) ? 'with' : 'without')); + } + + my $exitcode = $? >> 8; + if ($exitcode != 0) { + die("$cmd exited with exit code $exitcode"); + } } } else { foreach (@todo) { |