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
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

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