'cue', '--no-padding', '--best',
map({ ('-T', $_) } @tags),
'wav');
- if (WIFEXITED($status) and ($status = WEXITSTATUS($status)) != 0) {
- die("flac: $status");
+ if (WIFEXITED($status)) {
+ if (($status = WEXITSTATUS($status)) != 0) {
+ die("flac exited with status $status");
+ }
} elsif (WIFSIGNALED($status)) {
die("flac killed with signal ", WTERMSIG($status));
} elsif (WIFSTOPPED($status)) {
die("flac stopped with signal ", WSTOPSIG($status));
+ } else {
+ die("Major horkage on system(flac): \$? = $? \$! = $!");
}
verbose("Cleaning up $dir\n");
verbose("$pid finished (");
if (WIFEXITED($status)) {
- verbose('exited ', WEXITSTATUS($status));
+ verbose('exited with status ', WEXITSTATUS($status));
} elsif (WIFSIGNALED($status)) {
- verbose('signalled ', WTERMSIG($status));
+ verbose('killed with signal ', WTERMSIG($status));
} elsif (WIFSTOPPED($status)) {
- verbose('stopped ', WSTOPSIG($status));
+ verbose('stopped with signal ', WSTOPSIG($status));
}
verbose(")\n");
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): \$? = $? \$! = $!");
}