2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-19 04:22:15 +00:00

wait checks the error code first.

See #499.
This commit is contained in:
Klemens Morgenstern
2025-06-30 16:26:41 +08:00
committed by Klemens Morgenstern
parent 224e3cf9aa
commit f5c83eb9c5

View File

@@ -300,6 +300,8 @@ struct basic_process
*/
bool running()
{
if (!process_is_running(exit_status_))
return false;
error_code ec;
native_exit_code_type exit_code{};
auto r = process_handle_.running(exit_code, ec);
@@ -314,6 +316,8 @@ struct basic_process
/// Throwing @overload bool running(error_code & ec)
bool running(error_code & ec) noexcept
{
if (!process_is_running(exit_status_))
return false;
native_exit_code_type exit_code{};
auto r = process_handle_.running(exit_code, ec);
if (!ec && !r)