Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply to maint-5.14: #95748 IPC::Open3::open3(..., '-') broken #12327

Closed
p5pRT opened this issue Aug 11, 2012 · 4 comments
Closed

Apply to maint-5.14: #95748 IPC::Open3::open3(..., '-') broken #12327

p5pRT opened this issue Aug 11, 2012 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Aug 11, 2012

Migrated from rt.perl.org#114454 (status was 'resolved')

Searchable as RT114454$

@p5pRT
Copy link
Author

p5pRT commented Aug 11, 2012

From @jmdh

[This is possibly a duplicate ticket, but the first one hasn't shown
up in RT yet and also missed the attachment]

Attached is a trivial backport of f8b0429 to maint-5.14; this has
been reported in Debian[1] and OpenSuse[2] at least, and is a regression
compared to 5.10 (the feature doesn't work at all).

The patch did not quite apply cleanly owing to some refactoring between
5.14 and 5.16, so a sanity check would be appreciated.

Please consider this for inclusion in 5.14.3.

Thanks!
Dominic.

[1] <http​://bugs.debian.org/cgi-bin/bugreport.cgi?bug=683894>
[2] <https://bugzilla.novell.com/show_bug.cgi?id=755278>

--
Dominic Hargreaves | http​://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)

@p5pRT
Copy link
Author

p5pRT commented Aug 11, 2012

From @jmdh

0001-perl-95748-IPC-Open3-open3-.-broken.patch
From 55ec0f83de941e2c2415500e26d005b8758b3bb7 Mon Sep 17 00:00:00 2001
From: Salvador Fandino <sfandino@yahoo.com>
Date: Wed, 27 Jul 2011 09:20:29 -0700
Subject: [PATCH] [perl #95748] IPC::Open3::open3(..., '-') broken

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 |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ext/IPC-Open3/lib/IPC/Open3.pm b/ext/IPC-Open3/lib/IPC/Open3.pm
index 7015d27..e238528 100644
--- a/ext/IPC-Open3/lib/IPC/Open3.pm
+++ b/ext/IPC-Open3/lib/IPC/Open3.pm
@@ -284,11 +284,14 @@ sub _open3 {
 		} else {
 		    xopen \*STDERR, ">&STDOUT" if fileno(STDERR) != fileno(STDOUT);
 		}
-		return 0 if ($cmd[0] eq '-');
+		return 1 if ($cmd[0] eq '-');
 		exec @cmd or do {
 		    local($")=(" ");
 		    croak "$Me: exec of @cmd failed";
 		};
+	    } and do {
+                close $stat_w;
+		return 0;
 	    };
 
 	    my $bang = 0+$!;

@p5pRT
Copy link
Author

p5pRT commented Sep 8, 2012

From @jmdh

On Sat, Aug 11, 2012 at 05​:03​:36AM -0700, Dominic Hargreaves wrote​:

Attached is a trivial backport of f8b0429 to maint-5.14; this has
been reported in Debian[1] and OpenSuse[2] at least, and is a regression
compared to 5.10 (the feature doesn't work at all).

The patch did not quite apply cleanly owing to some refactoring between
5.14 and 5.16, so a sanity check would be appreciated.

Please consider this for inclusion in 5.14.3.

This was already voted on in cherrymaint, and I've now applied this
to maint-5.14.

--
Dominic Hargreaves | http​://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)

@p5pRT
Copy link
Author

p5pRT commented Sep 8, 2012

@jmdh - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant