Allow to get exit status from child processes

This commit is contained in:
Robin Gareus 2022-03-11 17:35:27 +01:00
parent d48b9af810
commit abbf1ca698
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04

View file

@ -431,7 +431,11 @@ SystemExec::wait (int options)
while (is_running()) { while (is_running()) {
WaitForSingleObject(pid->hProcess, 40); WaitForSingleObject(pid->hProcess, 40);
} }
return 0; DWORD exit_code;
if (GetExitCodeProcess(pid->hProcess, &exit_code)) {
return exit_code;
}
return -1;
} }
bool bool
@ -707,7 +711,7 @@ SystemExec::wait (int options)
} }
} /* else the process is still running */ } /* else the process is still running */
} }
return status; return WEXITSTATUS (status);
} }
bool bool