make IO::Pipe work on windows
p4raw-link: @16988 on //depot/maint-5.6/perl:
f7319d51d4524198950d828d33371d7b83ca3019
p4raw-id: //depot/perl@16990
p4raw-integrated: from //depot/maint-5.6/perl@16989 'merge in'
ext/IO/lib/IO/Pipe.pm (@5902..)
(IO::Pipe::End->new(), IO::Pipe::End->new());
}
-my $do_spawn = $^O eq 'os2';
+my $do_spawn = $^O eq 'os2' || $^O eq 'MSWin32';
sub _doit {
my $me = shift;
if ($do_spawn) {
require Fcntl;
$save = IO::Handle->new_from_fd($io, $mode);
+ my $handle = shift;
# Close in child:
- fcntl(shift, Fcntl::F_SETFD(), 1) or croak "fcntl: $!";
+ unless ($^O eq 'MSWin32') {
+ fcntl($handle, Fcntl::F_SETFD(), 1) or croak "fcntl: $!";
+ }
$fh = $rw ? ${*$me}[0] : ${*$me}[1];
} else {
shift;