summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/IPC
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-05 22:27:26 +0000
committerKarl Berry <karl@freefriends.org>2016-04-05 22:27:26 +0000
commitb56b320b5e2515160073fa1b469514002688fe11 (patch)
tree965a7100c5e45fca8ec803d22b8b6ce14fca4633 /Master/tlpkg/tlperl/lib/IPC
parentd26c206452d2e285c3bbf949f34011e4a55fd8f9 (diff)
tlperl 5.22.1 from siep
git-svn-id: svn://tug.org/texlive/trunk@40252 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/IPC')
-rw-r--r--Master/tlpkg/tlperl/lib/IPC/Open3.pm16
1 files changed, 10 insertions, 6 deletions
diff --git a/Master/tlpkg/tlperl/lib/IPC/Open3.pm b/Master/tlpkg/tlperl/lib/IPC/Open3.pm
index c8620b77ae7..7c7e9b532ad 100644
--- a/Master/tlpkg/tlperl/lib/IPC/Open3.pm
+++ b/Master/tlpkg/tlperl/lib/IPC/Open3.pm
@@ -9,7 +9,7 @@ require Exporter;
use Carp;
use Symbol qw(gensym qualify);
-$VERSION = '1.16';
+$VERSION = '1.18';
@ISA = qw(Exporter);
@EXPORT = qw(open3);
@@ -246,6 +246,7 @@ sub _open3 {
# A tie in the parent should not be allowed to cause problems.
untie *STDIN;
untie *STDOUT;
+ untie *STDERR;
close $stat_r;
require Fcntl;
@@ -361,7 +362,7 @@ sub open3 {
sub spawn_with_handles {
my $fds = shift; # Fields: handle, mode, open_as
my $close_in_child = shift;
- my ($fd, $pid, @saved_fh, $saved, %saved, @errs);
+ my ($fd, %saved, @errs);
foreach $fd (@$fds) {
$fd->{tmp_copy} = IO::Handle->new_from_fd($fd->{handle}, $fd->{mode});
@@ -372,10 +373,12 @@ sub spawn_with_handles {
unless eval { $fd->{handle}->isa('IO::Handle') } ;
# If some of handles to redirect-to coincide with handles to
# redirect, we need to use saved variants:
- $fd->{handle}->fdopen(defined fileno $fd->{open_as}
- ? $saved{fileno $fd->{open_as}} || $fd->{open_as}
- : $fd->{open_as},
- $fd->{mode});
+ my $open_as = $fd->{open_as};
+ my $fileno = fileno($open_as);
+ $fd->{handle}->fdopen(defined($fileno)
+ ? $saved{$fileno} || $open_as
+ : $open_as,
+ $fd->{mode});
}
unless ($^O eq 'MSWin32') {
require Fcntl;
@@ -387,6 +390,7 @@ sub spawn_with_handles {
}
}
+ my $pid;
unless (@errs) {
if (FORCE_DEBUG_SPAWN) {
pipe my $r, my $w or die "Pipe failed: $!";