summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-01-25 09:00:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-01-25 09:00:11 +0000
commit31015b6c29b06120bd8d52d261cbb114915bb556 (patch)
treeae330ef1bd8541627c77768472931c0eb7da709e
parent9dcda981bc33d9fb4e9b26acb9191600248842e2 (diff)
downloadurpmi-31015b6c29b06120bd8d52d261cbb114915bb556.tar
urpmi-31015b6c29b06120bd8d52d261cbb114915bb556.tar.gz
urpmi-31015b6c29b06120bd8d52d261cbb114915bb556.tar.bz2
urpmi-31015b6c29b06120bd8d52d261cbb114915bb556.tar.xz
urpmi-31015b6c29b06120bd8d52d261cbb114915bb556.zip
cleanup
-rwxr-xr-xurpmi28
1 files changed, 12 insertions, 16 deletions
diff --git a/urpmi b/urpmi
index 119a9f0f..d118044d 100755
--- a/urpmi
+++ b/urpmi
@@ -285,26 +285,22 @@ if ($logfile && !$INC{"Devel/Trace.pm"}) {
#- fork twice to copy stdout and stderr to $logfile
unless ($pid_out = open STDOUT, "|-") {
- local $_;
- while (<STDIN>) {
- open my $fh, ">>$logfile"; select $fh; $| = 1;
- select $SAVEOUT; $| = 1;
- $/ = \1;
- print $SAVEOUT $_;
- print $fh $_;
- close $fh;
+ select $SAVEOUT; $| = 1;
+ $/ = \1;
+ while (my $s = <STDIN>) {
+ open my $fh, ">>$logfile";
+ print $SAVEOUT $s;
+ print $fh $s;
}
exit 0;
}
unless ($pid_err = open STDERR, "|-") {
- local $_;
- while (<STDIN>) {
- open my $fh, ">>$logfile"; select $fh; $| = 1;
- select $SAVEERR; $| = 1;
- $/ = \1;
- print $SAVEERR $_;
- print $fh $_;
- close $fh;
+ select $SAVEERR; $| = 1;
+ $/ = \1;
+ while (my $s = <STDIN>) {
+ open my $fh, ">>$logfile";
+ print $SAVEERR $s;
+ print $fh $s;
}
exit 0;
}