Browse Source

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

git-svn-id: trunk@21478 -
marco 13 years ago
parent
commit
c7a90ef5d2
1 changed files with 7 additions and 3 deletions
  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