- if (scalar(@jobs) <= $MAXJOBS) {
- foreach $i (glob('*/tags')) {
- my $dir = dirname($i);
- my $pid =
- Jobs::newjob(sub {
- open(STDERR, ">$dir/log")
- or die("open(STDERR, >$dir/log): $!");
- return flac($dir);
- }, 'debug'=>$debug);
- verbose("new job $pid for $dir\n");
- @Jobs::jobs <= $MAXJOBS or last;
- }
- }
-
- for ($i = 0; $i <= $#finished; $i++) {
- my ($pid, $status) = Jobs::deljob($i);
- verbose("$pid finished (");
- if (WIFEXITED($status)) {
- verbose('exited with status ', WEXITSTATUS($status));
- } elsif (WIFSIGNALED($status)) {
- verbose('killed with signal ', WTERMSIG($status));
- } elsif (WIFSTOPPED($status)) {
- verbose('stopped with signal ', WSTOPSIG($status));
- }
- verbose(")\n");