Message-ID: <14934.6849.742435.23178@ix.netsoft.ro>
p4raw-id: //depot/perl@8340
}
$| = 1;
-print "1..15\n";
+print "1..16\n";
# External program 'tr' assumed.
open(PIPE, "|-") || (exec 'tr', 'YX', 'ko');
}
print "ok 15\n";
$? = 0;
+
+# check that child is reaped if the piped program can't be executed
+{
+ local $SIG{CHLD} = 'DEFAULT';
+ open NIL, '/no_such_process |';
+ close NIL;
+
+ my $child = 0;
+ eval {
+ local $SIG{ALRM} = sub { die; };
+ alarm 2;
+ $child = wait;
+ alarm 0;
+ };
+
+ print "not " if $child != -1;
+ print "ok 16\n";
+}
PerlLIO_close(pp[0]);
did_pipes = 0;
if (n) { /* Error */
+ int pid2, status;
if (n != sizeof(int))
Perl_croak(aTHX_ "panic: kid popen errno read");
+ do {
+ pid2 = wait4pid(pid, &status, 0);
+ } while (pid2 == -1 && errno == EINTR);
errno = errkid; /* Propagate errno from kid */
return Nullfp;
}