Browse Source

Merge pull request #23 from tsoding/windows-ci-fail

make CI fail on error
Alexey Kutepov 4 years ago
parent
commit
6cb6a6bdc2
1 changed files with 9 additions and 0 deletions
  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());
         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);
     CloseHandle(pid);
 #else
 #else
     for (;;) {
     for (;;) {