Do not swallow errors from GCC

Without this patch posubst always exits with 0. This is a problem when
chaining commands.
This commit is contained in:
Rene Kita
2022-01-14 13:11:04 +01:00
parent d5817a26c7
commit 97af1e481f

View File

@@ -52,5 +52,22 @@ foreach my $src (@src) {
} }
map {s/(.*\.c)$/.$1/} @ARGV; map {s/(.*\.c)$/.$1/} @ARGV;
my $err = 0;
system @ARGV; system @ARGV;
if ($? == -1) {
print "failed to execute: $!\n";
$err = 125;
}
elsif ($? & 127) {
printf "child died with signal %d\n", ($? & 127);
$err = 125;
}
else {
$err = $? >> 8;
if ($err != 0) {
printf "child exited with value %d\n", $err;
}
}
unlink @tmp; unlink @tmp;
exit $err;