2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-20 16:52:14 +00:00

Compare commits

...

1 Commits

Author SHA1 Message Date
Klemens Morgenstern
c8179a99e0 Checking waitpid res for zombie process reaping.
Fixes comment by @mathisloge in issue #447.
2025-05-24 09:38:36 +08:00
4 changed files with 8 additions and 4 deletions

View File

@@ -411,7 +411,8 @@ struct default_launcher
if (ec)
{
detail::on_error(*this, executable, argv, ec, inits...);
do { ::waitpid(pid, nullptr, 0); } while (errno == EINTR);
int res = 0;
do { res = ::waitpid(pid, nullptr, 0); } while ((res == -1) && (errno == EINTR));
return basic_process<Executor>{exec};
}
}

View File

@@ -124,7 +124,8 @@ struct fork_and_forget_launcher : default_launcher
if (ec)
{
detail::on_error(*this, executable, argv, ec, inits...);
do { ::waitpid(pid, nullptr, 0); } while (errno == EINTR);
int res = 0;
do { res = ::waitpid(pid, nullptr, 0); } while ((res != -1) && (errno == EINTR));
return basic_process<Executor>{exec};
}
}

View File

@@ -161,7 +161,8 @@ struct pdfork_launcher : default_launcher
if (ec)
{
detail::on_error(*this, executable, argv, ec, inits...);
do { ::waitpid(pid, nullptr, 0); } while (errno == EINTR);
int res = 0;
do { res = ::waitpid(pid, nullptr, 0); } while ((res == -1) && (errno == EINTR));
return basic_process<Executor>{exec};
}
}

View File

@@ -121,7 +121,8 @@ struct vfork_launcher : default_launcher
if (ec)
{
detail::on_error(*this, executable, argv, ec, inits...);
do { ::waitpid(pid, nullptr, 0); } while (errno == EINTR);
int res = 0;
do { res = ::waitpid(pid, nullptr, 0); } while ((res != -1) && (errno == EINTR));
return basic_process<Executor>{exec};
}