summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/ext/IPC-Open3/lib/IPC/Open3.pm
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2014-11-17 20:56:47 +0000
committerafresh1 <afresh1@openbsd.org>2014-11-17 20:56:47 +0000
commite5157e49389faebcb42b7237d55fbf096d9c2523 (patch)
tree268e07adf82302172a9a375d4378d98581823a65 /gnu/usr.bin/perl/ext/IPC-Open3/lib/IPC/Open3.pm
parentImport perl-5.20.1 (diff)
downloadwireguard-openbsd-e5157e49389faebcb42b7237d55fbf096d9c2523.tar.xz
wireguard-openbsd-e5157e49389faebcb42b7237d55fbf096d9c2523.zip
Fix merge conflicts, remove extra files, match upstream perl-5.20.1
ok deraadt@ sthen@ espie@ miod@
Diffstat (limited to 'gnu/usr.bin/perl/ext/IPC-Open3/lib/IPC/Open3.pm')
-rw-r--r--gnu/usr.bin/perl/ext/IPC-Open3/lib/IPC/Open3.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/gnu/usr.bin/perl/ext/IPC-Open3/lib/IPC/Open3.pm b/gnu/usr.bin/perl/ext/IPC-Open3/lib/IPC/Open3.pm
index 29612af7c0b..c8620b77ae7 100644
--- a/gnu/usr.bin/perl/ext/IPC-Open3/lib/IPC/Open3.pm
+++ b/gnu/usr.bin/perl/ext/IPC-Open3/lib/IPC/Open3.pm
@@ -9,7 +9,7 @@ require Exporter;
use Carp;
use Symbol qw(gensym qualify);
-$VERSION = '1.13';
+$VERSION = '1.16';
@ISA = qw(Exporter);
@EXPORT = qw(open3);
@@ -57,7 +57,8 @@ as file descriptors.
open3() returns the process ID of the child process. It doesn't return on
failure: it just raises an exception matching C</^open3:/>. However,
C<exec> failures in the child (such as no such file or permission denied),
-are just reported to CHLD_ERR, as it is not possible to trap them.
+are just reported to CHLD_ERR under Windows and OS/2, as it is not possible
+to trap them.
If the child process dies for any reason, the next write to CHLD_IN is
likely to generate a SIGPIPE in the parent, which is fatal by default.
@@ -98,7 +99,7 @@ C<cat -v> and continually read and write a line from it.
=item L<IPC::Open2>
-Like Open3 but without STDERR catpure.
+Like Open3 but without STDERR capture.
=item L<IPC::Run>
@@ -184,6 +185,10 @@ sub _open3 {
# it's too ugly to use @_ throughout to make perl do it for us
# tchrist 5-Mar-00
+ # Historically, open3(undef...) has silently worked, so keep
+ # it working.
+ splice @_, 0, 1, undef if \$_[0] == \undef;
+ splice @_, 1, 1, undef if \$_[1] == \undef;
unless (eval {
$_[0] = gensym unless defined $_[0] && length $_[0];
$_[1] = gensym unless defined $_[1] && length $_[1];
@@ -297,6 +302,7 @@ sub _open3 {
if ($bytes_read) {
(my $bang, $to_read) = unpack('II', $buf);
read($stat_r, my $err = '', $to_read);
+ waitpid $kidpid, 0; # Reap child which should have exited
if ($err) {
utf8::decode $err if $] >= 5.008;
} else {