LibCore: Make Process::wait_for_termination return exit code

This commit is contained in:
stasoid 2024-11-18 06:18:40 +05:00 committed by Andrew Kaster
parent 3468a83e45
commit 866609c682
Notes: github-actions[bot] 2024-11-19 22:28:23 +00:00
3 changed files with 8 additions and 9 deletions

View file

@ -146,7 +146,7 @@ pid_t Process::pid() const
return GetProcessId(m_handle);
}
ErrorOr<bool> Process::wait_for_termination()
ErrorOr<int> Process::wait_for_termination()
{
auto result = WaitForSingleObject(m_handle, INFINITE);
if (result == WAIT_FAILED)
@ -156,7 +156,7 @@ ErrorOr<bool> Process::wait_for_termination()
if (!GetExitCodeProcess(m_handle, &exit_code))
return Error::from_windows_error(GetLastError());
return !exit_code;
return exit_code;
}
}