瀏覽代碼

BUG: Corrected detection of exceptional exit code.

Brad King 22 年之前
父節點
當前提交
d23636d48b
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      Source/kwsys/ProcessWin32.c

+ 3 - 3
Source/kwsys/ProcessWin32.c

@@ -1334,7 +1334,7 @@ int kwsysProcess_WaitForExit(kwsysProcess* cp, double* userTimeout)
     {
     /* The children exited.  Report the outcome of the last process.  */
     cp->ExitCode = cp->CommandExitCodes[cp->NumberOfCommands-1];
-    if(cp->ExitCode & 0xC0000000)
+    if((cp->ExitCode & 0xF0000000) == 0xC0000000)
       {
       /* Child terminated due to exceptional behavior.  */
       cp->State = kwsysProcess_State_Exception;
@@ -1343,10 +1343,10 @@ int kwsysProcess_WaitForExit(kwsysProcess* cp, double* userTimeout)
       }
     else
       {
-      /* Child exited normally.  */
+      /* Child exited without exception.  */
       cp->State = kwsysProcess_State_Exited;
       cp->ExitException = kwsysProcess_Exception_None;
-      cp->ExitValue = cp->ExitCode & 0x000000FF;
+      cp->ExitValue = cp->ExitCode;
       }
     }