瀏覽代碼

* Simpler form of Terminate

Michaël Van Canneyt 2 年之前
父節點
當前提交
1083111ba1
共有 1 個文件被更改,包括 2 次插入6 次删除
  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 }