btrbk: show correct exit code on external command failure

pull/30/head
Axel Burri 2015-03-26 18:34:09 +01:00
parent 75dd565de4
commit 76e512117c
1 changed files with 3 additions and 1 deletions

4
btrbk
View File

@ -149,7 +149,9 @@ sub run_cmd($;$)
chomp($ret); chomp($ret);
TRACE "Command output:\n$ret"; TRACE "Command output:\n$ret";
if($?) { if($?) {
WARN "Command execution failed (exitcode=$?): \"$cmd\""; my $exitcode= $? >> 8;
my $signal = $? & 127;
WARN "Command execution failed (exitcode=$exitcode" . ($signal ? ", signal=$signal" : "") . "): \"$cmd\"";
return undef; return undef;
} }
else { else {