mirror of
https://github.com/boostorg/process.git
synced 2026-01-20 04:42:24 +00:00
Compare commits
1 Commits
boost-1.84
...
issue/285b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13c4b0aa14 |
@@ -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();
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ inline std::vector<native_handle_type> get_handles(std::error_code & ec)
|
||||
else
|
||||
ec.clear();
|
||||
|
||||
auto my_fd = dirfd(dir.get());
|
||||
auto my_fd = ::dirfd(dir.get());
|
||||
|
||||
struct ::dirent * ent_p;
|
||||
|
||||
@@ -117,7 +117,7 @@ struct limit_handles_ : handler_base_ext
|
||||
return;
|
||||
}
|
||||
|
||||
auto my_fd = dirfd(dir);
|
||||
auto my_fd = ::dirfd(dir);
|
||||
struct ::dirent * ent_p;
|
||||
|
||||
while ((ent_p = readdir(dir)) != nullptr)
|
||||
|
||||
@@ -112,15 +112,8 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code
|
||||
|
||||
filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
|
||||
{
|
||||
#if (defined(__linux__) || defined(__ANDROID__))
|
||||
return filesystem::canonical(
|
||||
filesystem::path("/proc") / std::to_string(pid) / "cwd", ec
|
||||
);
|
||||
#elif defined(__sun)
|
||||
return fileystem::canonical(
|
||||
filesystem::path("/proc") / std::to_string(pid) / "path/cwd", ec
|
||||
);
|
||||
#endif
|
||||
filesystem::path("/proc") / std::to_string(pid) / "cwd", ec);
|
||||
}
|
||||
|
||||
#elif defined(__FreeBSD__)
|
||||
|
||||
@@ -133,7 +133,7 @@ filesystem::path exe(boost::process::v2::pid_type pid, boost::system::error_code
|
||||
);
|
||||
#elif defined(__sun)
|
||||
return fileystem::canonical(
|
||||
filesystem::path("/proc") / std::to_string(pid) / "path/a.out", ec
|
||||
filesystem::path("/proc") / std::to_string(pid) / "path/a.out"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ process_standalone_test(pipe)
|
||||
|
||||
function(process_sub_launch_test name )
|
||||
add_executable(boost_process_${name} ${name}.cpp)
|
||||
target_link_libraries(boost_process_${name} Boost::process Boost::system Boost::filesystem Boost::scope_exit Boost::thread Boost::unit_test_framework)
|
||||
target_link_libraries(boost_process_${name} Boost::process Boost::system Boost::filesystem Boost::thread Boost::unit_test_framework)
|
||||
add_test(NAME boost_process_${name} COMMAND $<TARGET_FILE:boost_process_${name}> $<TARGET_FILE:boost_process_sub_launch> )
|
||||
endfunction()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user