In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/c1e7a0a2cac6d665e90d28a4b81db40e72276749?hp=b5525e6868ef0ad48a3350e324a271cc99817250>

- Log -----------------------------------------------------------------
commit c1e7a0a2cac6d665e90d28a4b81db40e72276749
Author: James E Keenan <[email protected]>
Date:   Mon Jul 21 21:02:53 2014 -0400

    Move two variable assignments outside of parens.
    
    Done for readability. Remove some unused variables. Move declaration of 
other
    variable closer to where it is used. Rationalize indentation on lines
    modified. Increment $VERSION.
    
    For: RT #122282 (additional)

M       ext/IPC-Open3/lib/IPC/Open3.pm

commit fe49d2ed6f822f90ed54ed40f03f306e831b8503
Author: Daniel Dragan <[email protected]>
Date:   Sun Jul 13 08:41:15 2014 -0400

    Open3.pm:spawn_with_handles remove alot of duplicate operators
    
    dont call fileno twice, don't deref key "open_as" 3 extra times.

M       ext/IPC-Open3/lib/IPC/Open3.pm
-----------------------------------------------------------------------

Summary of changes:
 ext/IPC-Open3/lib/IPC/Open3.pm | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/ext/IPC-Open3/lib/IPC/Open3.pm b/ext/IPC-Open3/lib/IPC/Open3.pm
index 99f120b..7c7e9b5 100644
--- a/ext/IPC-Open3/lib/IPC/Open3.pm
+++ b/ext/IPC-Open3/lib/IPC/Open3.pm
@@ -9,7 +9,7 @@ require Exporter;
 use Carp;
 use Symbol qw(gensym qualify);
 
-$VERSION       = '1.17';
+$VERSION       = '1.18';
 @ISA           = qw(Exporter);
 @EXPORT                = qw(open3);
 
@@ -362,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});
@@ -373,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;
@@ -388,6 +390,7 @@ sub spawn_with_handles {
        }
     }
 
+    my $pid;
     unless (@errs) {
        if (FORCE_DEBUG_SPAWN) {
            pipe my $r, my $w or die "Pipe failed: $!";

--
Perl5 Master Repository

Reply via email to