monitoring/PerlModules/NP/ProcessPool/Process.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
New commits: commit a54bc8d1ef83a951e8e945f11ca2d203b52311bf Author: Jan Pazdziora jpazdziora@redhat.com Date: Fri Feb 18 10:37:10 2011 +0100
Localize the filehandle globs; also use three-parameter opens.
diff --git a/monitoring/PerlModules/NP/ProcessPool/Process.pm b/monitoring/PerlModules/NP/ProcessPool/Process.pm index 3da3a95..ba18a9d 100644 --- a/monitoring/PerlModules/NP/ProcessPool/Process.pm +++ b/monitoring/PerlModules/NP/ProcessPool/Process.pm @@ -108,10 +108,12 @@ sub spawn { my $f;
$f = sprintf($stdout, $$); - open(STDOUT, ">$f") or die "Couldn't create $f: $!"; + local * STDOUT; + open(STDOUT, '>', $f) or die "Couldn't create $f: $!";
$f = sprintf($stderr, $$); - open(STDERR, ">>$f") or die "Couldn't create $f: $!"; + local * STDERR; + open(STDERR, '>>', $f) or die "Couldn't create $f: $!";
# Execute the command @@ -127,7 +129,8 @@ sub spawn { # Print the returned object to the rvfile my $frozen = freeze($return); $f = sprintf($retval, $$); - open(RV, ">$f") or die "Couldn't create $f: $!"; + local * RV; + open(RV, '>', $f) or die "Couldn't create $f: $!"; print RV $frozen; close(RV);
@@ -176,7 +179,8 @@ sub file_contents { # Read the file if cleanup has not been called yet. if (defined($file)) { $self->dprint(4, "\t$label: Fetching from ", $file, "\n"); - open(FILE, $file); + local * FILE; + open(FILE, '<', $file); $contents = join('', <FILE>); close(FILE); }
spacewalk-commits@lists.fedorahosted.org