diff options
author | Radu Greab <radu@netsoft.ro> | 2001-01-05 23:04:33 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-01-05 22:44:08 +0000 |
commit | faa466a70c12a1db89a71755b531f086987f0862 (patch) | |
tree | b2f4752da340340731e4a02f500108cd07f76096 /t | |
parent | 40d4dc3e90c1c3b3062669c126a23ad83b2ca878 (diff) | |
download | perl-faa466a70c12a1db89a71755b531f086987f0862.tar.gz |
Re: [ID 20010105.002] close() on process filehandle leaves defunct process
Message-ID: <14934.6849.742435.23178@ix.netsoft.ro>
p4raw-id: //depot/perl@8340
Diffstat (limited to 't')
-rwxr-xr-x | t/io/pipe.t | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/t/io/pipe.t b/t/io/pipe.t index 95cdd5587e..24c5d76cc6 100755 --- a/t/io/pipe.t +++ b/t/io/pipe.t @@ -11,7 +11,7 @@ BEGIN { } $| = 1; -print "1..15\n"; +print "1..16\n"; # External program 'tr' assumed. open(PIPE, "|-") || (exec 'tr', 'YX', 'ko'); @@ -185,3 +185,21 @@ if ($? != 42) { } 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"; +} |