2
0
Эх сурвалжийг харах

* fixed ExitCode translation in WaitProcess for Linux and Darwin (and
probably other BSD's as well)

Jonas Maebe 22 жил өмнө
parent
commit
fd581235c8

+ 8 - 3
rtl/unix/unix.pp

@@ -521,15 +521,16 @@ begin
   else
   else
    begin
    begin
 {$ifndef Solaris}
 {$ifndef Solaris}
-     WaitProcess:=s; // s<0 should not occur, but wie return also a negativ value
+     { at least correct for Linux and Darwin (JM) }
+     if (s and $7F)=0 then // Only this is a valid returncode
 {$else}
 {$else}
      if (s and $FF)=0 then // Only this is a valid returncode
      if (s and $FF)=0 then // Only this is a valid returncode
+{$endif}
       WaitProcess:=s shr 8
       WaitProcess:=s shr 8
      else if (s>0) then  // Until now there is not use of the highest bit , but check this for the future
      else if (s>0) then  // Until now there is not use of the highest bit , but check this for the future
       WaitProcess:=-s // normal case
       WaitProcess:=-s // normal case
      else
      else
       WaitProcess:=s; // s<0 should not occur, but wie return also a negativ value
       WaitProcess:=s; // s<0 should not occur, but wie return also a negativ value
-{$endif}
    end;
    end;
 end;
 end;
 
 
@@ -3058,7 +3059,11 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.26  2003-03-11 08:27:59  michael
+  Revision 1.27  2003-05-24 20:39:54  jonas
+    * fixed ExitCode translation in WaitProcess for Linux and Darwin (and
+      probably other BSD's as well)
+
+  Revision 1.26  2003/03/11 08:27:59  michael
   * stringtoppchar should use tabs instead of backspace as delimiter
   * stringtoppchar should use tabs instead of backspace as delimiter
 
 
   Revision 1.25  2002/12/18 16:50:39  marco
   Revision 1.25  2002/12/18 16:50:39  marco