Subject: | Incorrect handling of "failure to start program" |
run3 does not handle its internal call to system returning -1 (indicating failure to start program) properly. it ignores it, such that the only indication of a problem is $? being set to -1 when run3 returns. by this point $! has been trampled on, however, so there is no way to no /what/ the error was.
I've included a patch which makes run3 throw an error in this situation (as IPC::Run::run does), which seems to be the best course of action to me.
J
--
Jody Belka
knew (at) cpan (dot) org
diff -durN IPC-Run3-0.01.orig/lib/IPC/Run3.pm IPC-Run3-0.01/lib/IPC/Run3.pm
--- IPC-Run3-0.01.orig/lib/IPC/Run3.pm 2004-01-26 18:12:08.000000000 +0100
+++ IPC-Run3-0.01/lib/IPC/Run3.pm 2005-05-15 06:01:32.240943616 +0200
@@ -510,7 +510,7 @@
$sys_exit_time = gettimeofday() if profiling;
- unless ( defined $r ) {
+ unless ( defined $r && $r != -1 ) {
if ( debugging ) {
my $err_fh = defined $err_fh ? \*STDERR_SAVE : \*STDERR;
print $err_fh "run3(): system() error $!\n"