]> diplodocus.org Git - flac-archive/blobdiff - fa-flacd
(verbose): Use for instead of map.
[flac-archive] / fa-flacd
index cc8438fd28cd562c3576ca25288adf7802801784..167e6b9b978c80e274c9c47996f201bd26935289 100755 (executable)
--- a/fa-flacd
+++ b/fa-flacd
@@ -30,7 +30,7 @@ my @jobs;
 my @finished;
 
 sub verbose {
-    $verbose and map({ print(STDERR $_) } @_);
+    $verbose and print(STDERR $_) for @_;
 }
 
 # Return the ARTIST, ALBUM, and DATE followed by a list of all the
@@ -115,6 +115,8 @@ sub flac {
 
     rename("$artist/$album.flac-tmp", "$artist/$album.flac")
       or die("rename($artist/$album.flac-tmp, $artist/$album.flac): $!");
+
+    return 0;
 }
 
 sub reaper {
@@ -132,13 +134,12 @@ sub newjob {
     my $pid;
 
     $pid = fork();
-    if ($pid == -1) {
+    if (not defined($pid)) {
         die("fork: $!");
     } elsif ($pid == 0) {
         $SIG{CHLD} = 'IGNORE';
         open(STDERR, ">$dir/log") or die("open(STDERR, >$dir/log): $!");
-        flac($dir);
-        exit(0);
+        exit(flac($dir));
     }
 
     verbose("new job $pid for $dir\n");
@@ -152,7 +153,7 @@ sub deljob {
     my $status;
 
     $pid = $finished[$i][0];
-    $status = WEXITSTATUS($finished[$i][1]);
+    $status = $finished[$i][1];
 
     verbose("$pid finished (");
     if (WIFEXITED($status)) {