From: Junio C Hamano Date: Mon, 22 Apr 2013 18:26:55 +0000 (-0700) Subject: Merge branch 'tr/perl-keep-stderr-open' into maint X-Git-Tag: v1.8.2.2~31 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2483fba54e9a870e110448cd463c10684d45ed36?ds=inline;hp=-c Merge branch 'tr/perl-keep-stderr-open' into maint * tr/perl-keep-stderr-open: t9700: do not close STDERR perl: redirect stderr to /dev/null instead of closing --- 2483fba54e9a870e110448cd463c10684d45ed36 diff --combined perl/Git.pm index f207b47183,4778428830..a69467feaa --- a/perl/Git.pm +++ b/perl/Git.pm @@@ -1026,7 -1026,7 +1026,7 @@@ my (%TEMP_FILEMAP, %TEMP_FILES) =item temp_acquire ( NAME ) -Attempts to retreive the temporary file mapped to the string C. If an +Attempts to retrieve the temporary file mapped to the string C. If an associated temp file has not been created this session or was closed, it is created, cached, and set for autoflush and binmode. @@@ -1335,12 -1335,12 +1335,12 @@@ sub _command_common_pipe if (not defined $pid) { throw Error::Simple("open failed: $!"); } elsif ($pid == 0) { - if (defined $opts{STDERR}) { - close STDERR; - } if ($opts{STDERR}) { open (STDERR, '>&', $opts{STDERR}) or die "dup failed: $!"; + } elsif (defined $opts{STDERR}) { + open (STDERR, '>', '/dev/null') + or die "opening /dev/null failed: $!"; } _cmd_exec($self, $cmd, @args); }