[perl #95748] IPC::Open3::open3(..., '-') broken
authorSalvador Fandino <sfandino@yahoo.com>
Wed, 27 Jul 2011 16:20:29 +0000 (09:20 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Wed, 27 Jul 2011 16:21:47 +0000 (09:21 -0700)
IPC::Open3::open3($in, $out, $err, '-') is broken in 5.14.1

Because the old "return 0" used to return to user code now is wrapped inside and eval block.

This patch solves the problem.

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

index 8b9fd56..179313b 100644 (file)
@@ -269,12 +269,15 @@ sub _open3 {
                            fileno $_->{open_as};
                    }
                }
-               return 0 if ($_[0] eq '-');
+               return 1 if ($_[0] eq '-');
                exec @_ or do {
                    local($")=(" ");
                    croak "$Me: exec of @_ failed";
                };
-           };
+           } and do {
+                close $stat_w;
+                return 0;
+            };
 
            my $bang = 0+$!;
            my $err = $@;