+ WaitOnExit now really waits. Patch from Vincent Snijders

This commit is contained in:
michael 2004-09-02 06:50:15 +00:00
parent ed49f68542
commit 2c2eb6e018

View File

@ -53,10 +53,10 @@ begin
ExecVE(S,A);
end;
Function fpWaitPID(H: Longint; P : Pointer; OPts : Longint) : Integer;
Function fpWaitPID(H: Longint; P : Pointer; Opts : Longint) : Integer;
begin
Result:=WaitPID(Handle,@FExitCode,WNOHANG);
Result:=WaitPID(Handle,@FExitCode,Opts);
end;
Function fpKill(PID,SIG : Longint) : Longint;
@ -383,7 +383,7 @@ end;
Function TProcess.WaitOnExit : Dword;
begin
Result:=fpWaitPid(Handle,@FExitCode,WNOHANG);
Result:=fpWaitPid(Handle,@FExitCode,0);
If Result=Handle then
FExitCode:=WexitStatus(FExitCode);
FRunning:=False;