File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -1335,12 +1335,12 @@ sub _command_common_pipe {
1335
1335
if (not defined $pid ) {
1336
1336
throw Error::Simple(" open failed: $! " );
1337
1337
} elsif ($pid == 0) {
1338
- if (defined $opts {STDERR }) {
1339
- close STDERR ;
1340
- }
1341
1338
if ($opts {STDERR }) {
1342
1339
open (STDERR , ' >&' , $opts {STDERR })
1343
1340
or die " dup failed: $! " ;
1341
+ } elsif (defined $opts {STDERR }) {
1342
+ open (STDERR , ' >' , ' /dev/null' )
1343
+ or die " opening /dev/null failed: $! " ;
1344
1344
}
1345
1345
_cmd_exec($self , $cmd , @args );
1346
1346
}
Original file line number Diff line number Diff line change 45
45
# Failure cases for config:
46
46
# Save and restore STDERR; we will probably extract this into a
47
47
# "dies_ok" method and possibly move the STDERR handling to Git.pm.
48
- open our $tmpstderr , " >&STDERR" or die " cannot save STDERR" ; close STDERR ;
48
+ open our $tmpstderr , " >&STDERR" or die " cannot save STDERR" ;
49
+ open STDERR , " >" , " /dev/null" or die " cannot redirect STDERR to /dev/null" ;
49
50
is($r -> config(" test.dupstring" ), " value2" , " config: multivar" );
50
51
eval { $r -> config_bool(" test.boolother" ) };
51
52
ok($@ , " config_bool: non-boolean values fail" );
You can’t perform that action at this time.
0 commit comments