{
my $sig = shift;
- $interrupt = 1;
+ $interrupt = 2;
print STDERR "Received terminating signal ($sig).\n";
if ($^O !~ /MSWin32|dos/i) {
if ($format eq 'binary') {
$queue_size = 1;
$job_per_file = 1;
- @log_files = ();
}
my $pipe;
}
sleep(1);
}
- die "FATAL: Abort signal received when processing to next chunk\n" if ($interrupt);
+ die "FATAL: Abort signal received when processing to next chunk\n" if ($interrupt == 2);
+ last if ($interrupt);
push(@tempfiles, [ tempfile('tmp_pgbadgerXXXX', SUFFIX => '.bin', DIR => $TMP_DIR, UNLINK => 1 ) ]);
spawn sub {
&process_file($logfile, $tempfiles[-1]->[0], $chunks[$i], $chunks[$i+1], $i);
}
- die "FATAL: Abort signal received when processing next file\n" if ($interrupt);
+ die "FATAL: Abort signal received when processing next file\n" if ($interrupt == 2);
+ last if ($interrupt);
}
my $minproc = 1;