From b24f6fd844bc9d3bdb01d1bdf5886e37ce146633 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 9 Nov 2006 21:27:26 +0000 Subject: perl_checker compliance --- urpm.pm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'urpm.pm') diff --git a/urpm.pm b/urpm.pm index 9fc03daa..ae163fc4 100644 --- a/urpm.pm +++ b/urpm.pm @@ -2961,18 +2961,19 @@ sub install { #- allow process to be forked now. my $pid; - local (*CHILD_RETURNS, *ERROR_OUTPUT, $_); + my ($CHILD_RETURNS, $ERROR_OUTPUT); if ($options{fork}) { - pipe(CHILD_RETURNS, ERROR_OUTPUT); + pipe($CHILD_RETURNS, $ERROR_OUTPUT); defined($pid = fork()) or die "Can't fork: $!\n"; if ($pid) { # parent process - close ERROR_OUTPUT; + close $ERROR_OUTPUT; $urpm->{log}(N("using process %d for executing transaction", $pid)); #- now get all errors from the child and return them directly. my @l; - while () { + local $_; + while (<$CHILD_RETURNS>) { chomp; if (/^::logger_id:(\d+)(?::(\d+))?/) { $urpm->{logger_id} = $1; @@ -2982,7 +2983,7 @@ sub install { } } - close CHILD_RETURNS; + close $CHILD_RETURNS; waitpid($pid, 0); #- take care of return code from transaction, an error should be returned directly. $? >> 8 and exit $? >> 8; @@ -2990,7 +2991,7 @@ sub install { return @l; } else { # child process - close CHILD_RETURNS; + close $CHILD_RETURNS; } } #- beware this can be a child process or the main process now... @@ -3078,9 +3079,9 @@ sub install { #- now exit or return according to current status. if (defined $pid && !$pid) { #- child process - print ERROR_OUTPUT "::logger_id:$urpm->{logger_id}:$urpm->{logger_count}\n"; #- allow main urpmi to know transaction numbering... - print ERROR_OUTPUT "$_\n" foreach @l; - close ERROR_OUTPUT; + print $ERROR_OUTPUT "::logger_id:$urpm->{logger_id}:$urpm->{logger_count}\n"; #- allow main urpmi to know transaction numbering... + print $ERROR_OUTPUT "$_\n" foreach @l; + close $ERROR_OUTPUT; #- keep safe exit now (with destructor call). exit 0; } else { #- parent process -- cgit v1.2.1