unless eval { $fd->{handle}->isa('IO::Handle') } ;
# If some of handles to redirect-to coincide with handles to
# redirect, we need to use saved variants:
- $fd->{handle}->fdopen($saved{fileno $fd->{open_as}} || $fd->{open_as},
+ $fd->{handle}->fdopen(defined fileno $fd->{open_as}
+ ? $saved{fileno $fd->{open_as}} || $fd->{open_as}
+ : $fd->{open_as},
$fd->{mode});
}
unless ($^O eq 'MSWin32') {
use strict;
use warnings;
-plan 2;
+plan 1;
# [perl #76474]
{
prog => 'open STDIN, q _Makefile_ or die $!; open3(q _<&1_, my $out, undef, $ENV{PERLEXE}, q _-e0_)',
stderr => 1,
);
- {
- local $::TODO = "Bogus warning in IPC::Open3::spawn_with_handles"
- if $^O eq 'MSWin32';
- $stderr =~ s/(Use of uninitialized value.*Open3\.pm line \d+\.)\n//;
- is($1, undef, 'No bogus warning found');
- }
is $stderr, '',
"dup STDOUT in a child process by using its file descriptor";