X-Git-Url: https://diplodocus.org/git/flac-archive/blobdiff_plain/97f17277cdd7283dd88188cb33cbead53fb2647b..d5d85722f4fb0fc6ca61102b397aa51a96bddcc6:/fa-rip diff --git a/fa-rip b/fa-rip index 6a020ad..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): \$? = $? \$! = $!"); } @@ -137,7 +131,6 @@ sub rip { $device ||= '/dev/cdrom'; - print"$_\n" for ('cdparanoia', '-d', $device, "1-$trackcount", 'wav'); exec('cdparanoia', '-d', $device, "1-$trackcount", 'wav'); # exec prints its own error message so just die;