Add status code to os.execute for windows.
@@ -92,9 +92,11 @@ static int os_execute(DstArgs args) {
WaitForSingleObject(pi.hProcess, INFINITE);
// Close process and thread handles.
+ WORD status;
+ GetExitCodeProcess(pi.hProcess, &status);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
- DST_RETURN_INTEGER(args, 0);
+ DST_RETURN_INTEGER(args, (int32_t)status);
}
#else
static int os_execute(DstArgs args) {
