diff options
author | Larry Wall <lwall@netlabs.com> | 1992-06-08 04:52:53 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1992-06-08 04:52:53 +0000 |
commit | 68decaef0a08fcd5db3193f825cfdfc539b67ccb (patch) | |
tree | a16d0390e7acc0fcc16eba0be8259a2214efd9fe /lib/chat2.pl | |
parent | bf10efe7e35fa48859e575b890018da16608a9d7 (diff) | |
download | perl-68decaef0a08fcd5db3193f825cfdfc539b67ccb.tar.gz |
perl 4.0 patch 22: patch #20, continued
See patch #20.
Diffstat (limited to 'lib/chat2.pl')
-rw-r--r-- | lib/chat2.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/chat2.pl b/lib/chat2.pl index 916b9756af..662872c2d3 100644 --- a/lib/chat2.pl +++ b/lib/chat2.pl @@ -108,6 +108,7 @@ sub open_proc { ## public die "Cannot exec @cmd: $!"; } close(TTY); + $PID{$next} = $pid; $next; # return symbol for switcharound } @@ -258,10 +259,15 @@ sub print { ## public ## like close $handle sub close { ## public + local($pid); if ($_[0] =~ /$nextpat/) { + $pid = $PID{$_[0]}; *S = shift; + } else { + $pid = $PID{$next}; } close(S); + waitpid($pid,0); if (defined $S{"needs_close"}) { # is it a listen socket? local(*NS) = $S{"needs_close"}; delete $S{"needs_close"}; |