summaryrefslogtreecommitdiff
path: root/ext/IO
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-05 00:08:57 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-05 00:08:57 +0000
commitae63fb94ea3f9f5ebb77cffc8044abe3c6f2ec1e (patch)
treef2aca6411b6d6d0871480d3c8c3f71a3dbf31eee /ext/IO
parent5b86572164387fde73051a7dd9281f0f2dbcc081 (diff)
downloadperl-ae63fb94ea3f9f5ebb77cffc8044abe3c6f2ec1e.tar.gz
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..)
Diffstat (limited to 'ext/IO')
-rw-r--r--ext/IO/lib/IO/Pipe.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/IO/lib/IO/Pipe.pm b/ext/IO/lib/IO/Pipe.pm
index 0b5aac46ef..c70adfed87 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;