瀏覽代碼

make CI fail on error

Ciremun 4 年之前
父節點
當前提交
1fb458a76c
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      nobuild.h

+ 9 - 0
nobuild.h

@@ -576,6 +576,15 @@ void pid_wait(Pid pid)
         PANIC("could not wait on child process: %s", GetLastErrorAsString());
     }
 
+    DWORD exit_status;
+    if (GetExitCodeProcess(pid, &exit_status) == 0) {
+        PANIC("could not get process exit code: %lu", GetLastError());
+    }
+
+    if (exit_status != 0) {
+        PANIC("command exited with exit code %lu", exit_status);
+    }
+
     CloseHandle(pid);
 #else
     for (;;) {