2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-20 04:42:24 +00:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Klemens Morgenstern
9ed2fef8cd Fixed wrong type in probe_on_error on windows.
Closes #491.
2025-05-24 09:40:16 +08:00
5 changed files with 5 additions and 9 deletions

View File

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

View File

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

View File

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

View File

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

View File

@@ -109,7 +109,7 @@ inline std::false_type probe_on_error(
template<typename Launcher, typename Init>
inline auto probe_on_error(Launcher & launcher, Init && init, derived && )
-> std::is_same<error_code, decltype(init.on_error(launcher, std::declval<const filesystem::path &>(), std::declval<std::wstring &>(), std::declval<std::error_code&>()))>;
-> std::is_same<error_code, decltype(init.on_error(launcher, std::declval<const filesystem::path &>(), std::declval<std::wstring &>(), std::declval<error_code&>()))>;
template<typename Launcher, typename Init>
using has_on_error = decltype(probe_on_error(std::declval<Launcher&>(), std::declval<Init>(), derived{}));