Код: Выделить всё
Function TProcess.Terminate(AExitCode : Integer) : Boolean;
begin
Result:=False;
Result:=fpkill(Handle,SIGTERM)=0;
If Result then
begin
If Running then
Result:=fpkill(Handle,SIGKILL)=0;
end;
{ the fact that the signal has been sent does not
mean that the process has already handled the
signal -> wait instead of calling getexitstatus }
if Result then
WaitOnExit;
end; 