]> diplodocus.org Git - flac-archive/blobdiff - fa-rip
Need the g (global) flag on that substitution operation.
[flac-archive] / fa-rip
diff --git a/fa-rip b/fa-rip
index 5e91afa3f71d0f7034f6c8a038ed16c86217edd1..1a9bc2a10a8e228c2e31f16d01cb59e194d7dba6 100755 (executable)
--- 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): \$? = $? \$! = $!");
     }