diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-09 21:27:26 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-09 21:27:26 +0000 |
commit | b24f6fd844bc9d3bdb01d1bdf5886e37ce146633 (patch) | |
tree | ebb445f446e94f8363e175ede6eadabcf764524c /urpm.pm | |
parent | 88b37e624a74f9f0515ecded2819197a98b6bec0 (diff) | |
download | urpmi-b24f6fd844bc9d3bdb01d1bdf5886e37ce146633.tar urpmi-b24f6fd844bc9d3bdb01d1bdf5886e37ce146633.tar.gz urpmi-b24f6fd844bc9d3bdb01d1bdf5886e37ce146633.tar.bz2 urpmi-b24f6fd844bc9d3bdb01d1bdf5886e37ce146633.tar.xz urpmi-b24f6fd844bc9d3bdb01d1bdf5886e37ce146633.zip |
perl_checker compliance
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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 (<CHILD_RETURNS>) { + 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 |