From: Jarkko Hietaniemi Date: Wed, 5 Jun 2002 00:08:57 +0000 (+0000) Subject: Integrate maintperl change #16988; X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ae63fb94ea3f9f5ebb77cffc8044abe3c6f2ec1e;p=p5sagit%2Fp5-mst-13.2.git Integrate maintperl change #16988; 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..) --- diff --git a/ext/IO/lib/IO/Pipe.pm b/ext/IO/lib/IO/Pipe.pm index 0b5aac4..c70adfe 100644 --- a/ext/IO/lib/IO/Pipe.pm +++ b/ext/IO/lib/IO/Pipe.pm @@ -38,7 +38,7 @@ sub handles { (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; @@ -56,8 +56,11 @@ sub _doit { 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;