瀏覽代碼

* if wifexited, pass exitcode unmodified. Bug #22055, though it doesn't close that.

git-svn-id: trunk@21478 -
marco 13 年之前
父節點
當前提交
c7a90ef5d2
共有 1 個文件被更改,包括 7 次插入3 次删除
  1. 7 3
      packages/fcl-process/src/unix/process.inc

+ 7 - 3
packages/fcl-process/src/unix/process.inc

@@ -46,9 +46,13 @@ begin
   until (res<>-1) or (fpgeterrno<>ESysEINTR);
   until (res<>-1) or (fpgeterrno<>ESysEINTR);
   result:=res=Handle;
   result:=res=Handle;
   If Result then
   If Result then
-    FExitCode:=wexitstatus(FExitCode)
-  else
-    FexitCode:=0;
+   begin
+      if wifexited(FExitCode) then
+        FExitCode:=wexitstatus(FExitCode);
+      // else pass errorvalue unmodified like shell does, bug #22055
+     end
+   else
+    FexitCode:=-1; // was 0, better testable for abnormal exit.
 end;
 end;
 
 
 Type
 Type