X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/0f7f19818130c6cb41a9ca05df214e6a4218e700..d5d85722f4fb0fc6ca61102b397aa51a96bddcc6:/fa-rip diff --git a/fa-rip b/fa-rip index 5e91afa..1a9bc2a 100755 --- a/fa-rip +++ b/fa-rip @@ -31,22 +31,16 @@ sub run_or_die { my $command = shift; my $status; - system($command); + $status = system($command); - if (WIFEXITED($?)) { - $status = WEXITSTATUS($?); - if ($status != 0) { - die("$command exited $status"); + if (WIFEXITED($status)) { + if (($status = WEXITSTATUS($status)) != 0) { + die("$command exited with status $status"); } - - } elsif (WIFSIGNALED($?)) { - $status = WTERMSIG($?); - die("$command signalled $status"); - - } elsif (WIFSTOPPED($?)) { - $status = WSTOPSIG($?); - die("$command stopped $status"); - + } elsif (WIFSIGNALED($status)) { + die("$command killed with signal ", WTERMSIG($status)); + } elsif (WIFSTOPPED($status)) { + die("$command stopped with signal ", WSTOPSIG($status)); } else { die("Major horkage on system($command): \$? = $? \$! = $!"); }