Skip Menu |

This queue is for tickets about the IPC-Run3 CPAN distribution.

Report information
The Basics
Id: 14272
Status: resolved
Priority: 0/
Queue: IPC-Run3

People
Owner: RSCHUPP [...] cpan.org
Requestors: hutchinson.chris [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.020
Fixed in: (no value)



Subject: check for system() -1 in run3 breaks in forked child
The change in ver 0.20 to die if the system() call returns -1 breaks code which uses run3 within a forked child process. This affects perl 5.8.7, 5.8.6, and earlier. The offending line (517) checks "unless ( defined $r && $r != -1 ) {" This breaks several things where we fork a child to run an external process. The reason: system() returns -1 when called in a child process. See perlbug http://rt.perl.org/rt3/Ticket/Display.html?id=36976 I can't suggest an ideal solution, but it would be useful to be able to tell run3 to not die when system() returns -1.
IPC::Run3 0.041 adds run3() option "return_if_system_error"; causes run3() to return normally when system() returns -1; caller should detect this by checking $? (== -1) and $! for reason.