This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Avoid POSIX::close when closing files by descriptor in IPC::Open3
authorSteve Hay <steve.m.hay@googlemail.com>
Wed, 12 Sep 2012 22:36:41 +0000 (23:36 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Thu, 13 Sep 2012 20:09:17 +0000 (21:09 +0100)
commit8700fd387632099e570555f059e008cb2dff2759
treed502688c5dd64eaa32e9b613ff30685a7747236e
parent650f067c54a3baf4a72cb6953bd10c90abb28bd2
Avoid POSIX::close when closing files by descriptor in IPC::Open3

Closing a file descriptor with POSIX::close bypasses PerlIO's ref-counting
of file descriptors and leads to MSVC++'s invalid parameter handler being
triggered when the PerlIO stream is closed later because that attempts to
close the underlying file descriptor again, but it's already closed.

So instead, we effectively fdopen() a new PerlIO stream and then close it
again to effect the closure of the file descriptor.
ext/IPC-Open3/lib/IPC/Open3.pm