parallel: Unlink should not happen with --files.

This commit is contained in:
Ole Tange 2013-01-21 23:09:00 +01:00
parent 592a6482a8
commit 05e1cf9ef4

View file

@ -3850,10 +3850,11 @@ sub start {
my ($outfh,$errfh,$name); my ($outfh,$errfh,$name);
# To group we create temporary files for STDOUT and STDERR # To group we create temporary files for STDOUT and STDERR
# To avoid the cleanup unlink the files immediately (but keep them open) # To avoid the cleanup unlink the files immediately (but keep them open)
($outfh, $name) = ::tempfile(SUFFIX => ".par", UNLINK => 1); my $unlink = $opt::files ? 0 : 1;
($outfh, $name) = ::tempfile(SUFFIX => ".par", UNLINK => $unlink);
$job->set_stdoutfilename($name); $job->set_stdoutfilename($name);
$opt::files or unlink $name; $unlink and unlink $name;
($errfh, $name) = ::tempfile(SUFFIX => ".par", UNLINK => 1); ($errfh, $name) = ::tempfile(SUFFIX => ".par", UNLINK => $unlink);
unlink $name; unlink $name;
open OUT, '>&', $outfh or ::die_bug("Can't redirect STDOUT: $!"); open OUT, '>&', $outfh or ::die_bug("Can't redirect STDOUT: $!");