From eed434bb222db51ee00b33c20134def3015ac4b9 Mon Sep 17 00:00:00 2001 From: Klemens Date: Sat, 24 Dec 2022 11:11:53 +0800 Subject: [PATCH] Reenabled pdfork. --- .drone.star | 4 ++-- include/boost/process/v2/detail/config.hpp | 2 +- .../v2/detail/process_handle_fd_or_signal.hpp | 12 ++++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.drone.star b/.drone.star index 24fb934bc..49a584bde 100644 --- a/.drone.star +++ b/.drone.star @@ -14,8 +14,8 @@ windowsglobalimage="cppalliance/dronevs2019" def main(ctx): return [ - freebsd_cxx("gcc 11 freebsd", "g++-11", buildtype="boost", buildscript="drone", freebsd_version="13.1", environment={'B2_TOOLSET': 'gcc-11', 'B2_CXXSTD': '17,20', 'B2_LINKFLAGS': '-Wl,-rpath=/usr/local/lib/gcc11'}, globalenv=globalenv), - freebsd_cxx("clang 14 freebsd", "clang++-14", buildtype="boost", buildscript="drone", freebsd_version="13.1", environment={'B2_TOOLSET': 'clang-14', 'B2_CXXSTD': '17,20'}, globalenv=globalenv), + freebsd_cxx("gcc freebsd", "g++", buildtype="boost", buildscript="drone", freebsd_version="13.1", environment={'B2_TOOLSET': 'gcc', 'B2_CXXSTD': '11'}, globalenv=globalenv), + freebsd_cxx("clang 14 freebsd", "clang++-14", buildtype="boost", buildscript="drone", freebsd_version="13.1", environment={'B2_TOOLSET': 'clang-14', 'B2_CXXSTD': '11'}, globalenv=globalenv), linux_cxx("docs", "", packages="docbook docbook-xml docbook-xsl xsltproc libsaxonhe-java default-jre-headless flex libfl-dev bison unzip rsync", image="cppalliance/droneubuntu1804:1", buildtype="docs", buildscript="drone", environment={"COMMENT": "docs"}, globalenv=globalenv), linux_cxx("asan", "g++-8", packages="g++-8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'asan', 'B2_VARIANT': 'debug', 'B2_TOOLSET': 'gcc-8', 'B2_CXXSTD': '11', 'B2_ASAN': '1', 'B2_DEFINES': 'BOOST_NO_STRESS_TEST=1', 'DRONE_EXTRA_PRIVILEGED': 'True', 'DRONE_JOB_UUID': '356a192b79'}, globalenv=globalenv, privileged=True), linux_cxx("ubsan", "g++-8", packages="g++-8", buildtype="boost", buildscript="drone", image=linuxglobalimage, environment={'COMMENT': 'ubsan', 'B2_VARIANT': 'debug', 'B2_TOOLSET': 'gcc-8', 'B2_CXXSTD': '11', 'B2_UBSAN': '1', 'B2_DEFINES': 'BOOST_NO_STRESS_TEST=1', 'B2_LINKFLAGS': '-fuse-ld=gold', 'DRONE_JOB_UUID': '77de68daec'}, globalenv=globalenv), diff --git a/include/boost/process/v2/detail/config.hpp b/include/boost/process/v2/detail/config.hpp index a38c89ed9..92aadb8b4 100644 --- a/include/boost/process/v2/detail/config.hpp +++ b/include/boost/process/v2/detail/config.hpp @@ -163,7 +163,7 @@ BOOST_PROCESS_V2_END_NAMESPACE #endif #endif -#if defined(__FreeBSD__) && defined(BOOST_PROCESS_V2_ENABLE_PDFORK) +#if defined(__FreeBSD__) && !defined(BOOST_PROCESS_V2_DISABLE_PDFORK) #define BOOST_PROCESS_V2_PDFORK 1 #define BOOST_PROCESS_V2_HAS_PROCESS_HANDLE 1 #endif diff --git a/include/boost/process/v2/detail/process_handle_fd_or_signal.hpp b/include/boost/process/v2/detail/process_handle_fd_or_signal.hpp index 5c2416765..ab0c664ad 100644 --- a/include/boost/process/v2/detail/process_handle_fd_or_signal.hpp +++ b/include/boost/process/v2/detail/process_handle_fd_or_signal.hpp @@ -315,9 +315,13 @@ struct basic_process_handle_fd_or_signal struct async_wait_op_ { - net::posix::basic_descriptor &descriptor; + net::posix::basic_stream_descriptor &descriptor; net::basic_signal_set &handle; pid_type pid_; + async_wait_op_(net::posix::basic_stream_descriptor &descriptor, + net::basic_signal_set &handle, + pid_type pid_) : descriptor(descriptor), handle(handle), pid_(pid_) {} + bool needs_post = true; template @@ -346,7 +350,7 @@ struct basic_process_handle_fd_or_signal needs_post = false; if (descriptor.is_open()) descriptor.async_wait( - net::posix::descriptor_base::wait_read, + net::posix::descriptor_base::wait_error, std::move(self)); else handle.async_wait(std::move(self)); @@ -379,10 +383,10 @@ struct basic_process_handle_fd_or_signal WaitHandler = net::default_completion_token_t> auto async_wait(WaitHandler &&handler = net::default_completion_token_t()) -> decltype(net::async_compose( - async_wait_op_{descriptor_, signal_set_, pid_}, handler, descriptor_)) + async_wait_op_(descriptor_, signal_set_, pid_), handler, descriptor_)) { return net::async_compose( - async_wait_op_{descriptor_, signal_set_, pid_}, handler, descriptor_); + async_wait_op_(descriptor_, signal_set_, pid_), handler, descriptor_); } }; }