Expose a single process_wait()

There were two versions: process_wait() and process_wait_noclose().

Expose a single version with a flag (it was already implemented that way
internally).
This commit is contained in:
Romain Vimont
2021-01-22 18:48:17 +01:00
parent b8edcf52b0
commit 6a50231698
6 changed files with 13 additions and 35 deletions

View File

@@ -59,8 +59,8 @@ process_terminate(HANDLE handle) {
return TerminateProcess(handle, 1);
}
static exit_code_t
process_wait_internal(HANDLE handle, bool close) {
exit_code_t
process_wait(HANDLE handle, bool close) {
DWORD code;
if (WaitForSingleObject(handle, INFINITE) != WAIT_OBJECT_0
|| !GetExitCodeProcess(handle, &code)) {
@@ -73,16 +73,6 @@ process_wait_internal(HANDLE handle, bool close) {
return code;
}
exit_code_t
process_wait(HANDLE handle) {
return process_wait_internal(handle, true);
}
exit_code_t
process_wait_noclose(HANDLE handle) {
return process_wait_internal(handle, false);
}
void
process_close(HANDLE handle) {
bool closed = CloseHandle(handle);