From eaa1abb2fdc36636339e3f42646591fc4a7aaaba Mon Sep 17 00:00:00 2001 From: g00r00 Date: Tue, 1 Oct 2013 19:01:10 -0400 Subject: [PATCH] Zombie killer --- mystic/mis_client_telnet.pas | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/mystic/mis_client_telnet.pas b/mystic/mis_client_telnet.pas index 693064d..cc21222 100644 --- a/mystic/mis_client_telnet.pas +++ b/mystic/mis_client_telnet.pas @@ -132,14 +132,15 @@ End; {$IFDEF USEFORK} Procedure TTelnetServer.Execute; Var - Num : LongInt; - NI : TNodeInfoRec; - PID : LongInt; - PTYFD : LongInt; - RDFDSET : TFDSet; - Count : LongInt; - Buffer : Array[1..8 * 1024] of Char; - MaxFD : LongInt; + Num : LongInt; + NI : TNodeInfoRec; + PID : LongInt; + PTYFD : LongInt; + RDFDSET : TFDSet; + Count : LongInt; + Buffer : Array[1..8 * 1024] of Char; + MaxFD : LongInt; + WaitStat : LongInt; Begin Client.FTelnetServer := True; @@ -198,6 +199,9 @@ Begin fpClose (PTYFD); + Repeat + Until fpWaitPID(PID, WaitStat, WUNTRACED) = PID; + NI.Busy := False; NI.IP := ''; NI.User := '';