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

Compare commits

...

1 Commits

Author SHA1 Message Date
Klemens Morgenstern
13c4b0aa14 added wait_pid to be run in set_error. 2023-10-05 10:51:24 +08:00

View File

@@ -262,7 +262,10 @@ class executor
return;
//EAGAIN not yet forked, EINTR interrupted, i.e. try again
else if ((err != EAGAIN ) && (err != EINTR))
set_error(std::error_code(err, std::system_category()), "Error read pipe");
{
set_error(std::error_code(err, std::system_category()), "Error read pipe");
return;
}
}
set_error(ec, std::move(msg));
}
@@ -324,6 +327,9 @@ public:
void set_error(const std::error_code &ec, const char* msg)
{
if (pid != 0 && pid != -1) // reap-zombie
::waitpid(pid, nullptr, 0);
internal_error_handle(ec, msg, has_error_handler(), has_ignore_error(), shall_use_vfork());
}
void set_error(const std::error_code &ec, const std::string &msg) {set_error(ec, msg.c_str());};
@@ -445,7 +451,6 @@ child executor<Sequence>::invoke(boost::mpl::false_, boost::mpl::false_)
if (_ec)
{
//if an error occurred we need to reap the child process
::waitpid(this->pid, nullptr, WNOHANG);
boost::fusion::for_each(seq, call_on_error(*this, _ec));
return child();
}