Browse Source

* Simpler form of Terminate

Michaël Van Canneyt 2 years ago
parent
commit
1083111ba1
1 changed files with 2 additions and 6 deletions
  1. 2 6
      packages/fcl-process/src/unix/process.inc

+ 2 - 6
packages/fcl-process/src/unix/process.inc

@@ -530,13 +530,9 @@ end;
 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;
+  If Result and Running then
+    Result:=fpkill(Handle,SIGKILL)=0;
   { the fact that the signal has been sent does not
     mean that the process has already handled the
     signal -> wait instead of calling getexitstatus }