Return non-zero when launched program does not exist.

Closes: #783195
Thanks: Elliott Mitchell <ehem+debian@m5p.com>
parent 694e2393
Pipeline #37071 passed with stages
in 5 minutes and 26 seconds
......@@ -557,11 +557,20 @@ foreach (@files) {
} else {
no warnings 'exec';
$res = system $comm;
$res = int($res/256);
}
if ($res != 0) {
print STDERR "Warning: program returned non-zero exit code \#$res\n";
$retcode = $res;
if ($res != 0) {
if (!($res & 0xFF)) {
print STDERR "Warning: program returned non-zero exit code \#$res\n";
$retcode = $res >> 8;
} elsif ($res == -1) {
print STDERR "Error: program failed to execute: $!\n";
$retcode = -1;
} else {
my $signal = $? & 0x7F;
my $core = ($? & 0x80) ? ' (core dumped)' : '';
print STDERR "Warning: program died on signal ${signal}${core}\n";
$retcode = -1;
}
}
}
$done=1;
unlink $tmpfile if $tmpfile;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment