2
0
mirror of https://github.com/boostorg/process.git synced 2026-01-21 17:12:19 +00:00

Compare commits

..

39 Commits

Author SHA1 Message Date
Klemens Morgenstern
f6960d5c40 Added probe. 2022-10-21 13:33:37 +08:00
Klemens Morgenstern
292ac5ceb0 Added probe. 2022-10-21 13:24:31 +08:00
Klemens Morgenstern
7422dfc9c8 Added probe. 2022-10-21 13:21:59 +08:00
Klemens Morgenstern
b2c94f02d7 Added probe. 2022-10-21 13:12:35 +08:00
Klemens Morgenstern
31494428ca Added probe. 2022-10-21 12:40:51 +08:00
Klemens Morgenstern
41e3178727 Added probe. 2022-10-21 12:39:36 +08:00
Klemens Morgenstern
4b4019500d Added probe. 2022-10-21 12:37:37 +08:00
Klemens Morgenstern
50ccdf395f Added probe. 2022-10-21 12:35:07 +08:00
Klemens Morgenstern
db1381ada8 Added probe. 2022-10-21 12:28:15 +08:00
Klemens Morgenstern
9fba0a72c9 Added probe. 2022-10-21 12:26:00 +08:00
Klemens Morgenstern
6ced49d6e1 Added probe. 2022-10-21 12:21:03 +08:00
Klemens Morgenstern
a6291c19f6 Added probe. 2022-10-21 12:17:14 +08:00
Klemens Morgenstern
701d161f15 Added probe. 2022-10-21 12:16:08 +08:00
Klemens Morgenstern
0041a0b292 Added probe. 2022-10-21 12:14:51 +08:00
Klemens Morgenstern
e049859d28 Merge branch 'drone5' into freebsd-exp 2022-10-21 12:06:03 +08:00
Klemens Morgenstern
ecb384b253 Improved error message for OSX. 2022-10-21 12:03:31 +08:00
sdarwin
8f47527724 Drone: update freebsd jobs 2022-10-12 17:42:52 -06:00
Klemens Morgenstern
05bce942c1 passing a pipe into sh test. 2022-10-12 11:54:05 +08:00
Klemens Morgenstern
dcf5d8ce41 Added return_type to async_result<code_as_error_t> 2022-10-12 10:54:30 +08:00
Klemens Morgenstern
4209f8ee6e Minor bugfixes 2022-10-12 01:12:28 +08:00
Klemens Morgenstern
d9513269cc Enabled freebsd build 2022-10-11 21:03:33 +08:00
Klemens
293f28dab6 Fixed async_system. 2022-09-20 13:45:43 +08:00
Klemens
fe1b629b5d Added bind_launcher. 2022-09-18 22:13:57 +08:00
Klemens
278fa57214 Added code_as_error completion handler. 2022-09-18 17:56:47 +08:00
Klemens Morgenstern
1addfba12e Added WIN32_LEAN_AND_MEAN to cmake 2022-09-17 20:39:01 +08:00
Klemens Morgenstern
4cc469b2a4 Merge pull request #252 from grtowel1510f/patch-1
fix issue #251 - fix simple shell command in posix
2022-09-14 11:38:37 +08:00
Klemens Morgenstern
6e4d1e29d2 Merge pull request #271 from boostorg/shell_v2
Shell v2
2022-09-02 20:30:03 +08:00
Klemens Morgenstern
dada865fd0 Merge pull request #269 from boostorg/klemens-morgenstern-patch-2
Closes #266
2022-09-02 20:29:20 +08:00
Klemens Morgenstern
380dd1b00f Merge pull request #268 from boostorg/klemens-morgenstern-patch-1
Closes #267
2022-09-02 20:28:50 +08:00
Klemens
7832cb6af3 Shell(posix) fixes. 2022-09-02 18:43:35 +08:00
Klemens Morgenstern
68f4c50be9 Exeuction support for shell. 2022-09-02 18:25:40 +08:00
Klemens Morgenstern
cd226a7616 Implemented shell on windows. 2022-09-02 17:05:49 +08:00
Klemens Morgenstern
4243ce72f8 Windows bugfixes. 2022-09-02 16:46:45 +08:00
Klemens
9065833e61 Added shell class. 2022-08-31 23:54:22 +08:00
Klemens Morgenstern
7cb7af6c8b Closes #267 2022-08-31 15:40:57 +08:00
Klemens Morgenstern
90cbe7cec0 Closes #266 2022-08-31 15:35:51 +08:00
Klemens
df33c1ad7b Fixed unsafe post-fork allocs for fd_whitelist. 2022-08-31 15:35:41 +08:00
Klemens
bbabea30dd Added reaping child for execve error, closes #265. 2022-08-31 15:35:41 +08:00
grtowel1510f
8a61f8daa3 fix issue #251 - fix simple shell command in posix
see issue #251 for description.
2022-05-21 14:59:37 +00:00
5 changed files with 21 additions and 14 deletions

View File

@@ -142,7 +142,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

View File

@@ -153,9 +153,12 @@ struct basic_process_handle_fd_or_signal
void wait(native_exit_code_type &exit_status, error_code &ec)
{
if (pid_ <= 0)
return;
while (::waitpid(pid_, &exit_status, 0) < 0)
int res = 0;
while ((res = ::waitpid(pid_, &exit_status, 0)) < 0)
{
if (errno != EINTR)
{
@@ -163,7 +166,6 @@ struct basic_process_handle_fd_or_signal
break;
}
}
}
void wait(native_exit_code_type &exit_status)
@@ -286,31 +288,37 @@ struct basic_process_handle_fd_or_signal
struct async_wait_op_
{
BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::basic_descriptor<Executor> &descriptor;
BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::basic_stream_descriptor<Executor> &descriptor;
BOOST_PROCESS_V2_ASIO_NAMESPACE::basic_signal_set<Executor> &handle;
pid_type pid_;
bool needs_post = true;
template<typename Self>
void operator()(Self &&self, error_code ec = {}, int = 0)
void operator()(Self &&self, error_code ec = {}, int res = 0)
{
native_exit_code_type exit_code{};
printf("RES : %d -> %s\n", res, ec.message().c_str());
native_exit_code_type exit_code = -1;
int wait_res = -1;
if (pid_ <= 0) // error, complete early
ec = BOOST_PROCESS_V2_ASIO_NAMESPACE::error::bad_descriptor;
else
{
printf("test in %d\n", errno);
wait_res = ::waitpid(pid_, &exit_code, WNOHANG);
if (wait_res == -1)
ec = get_last_error();
else
ec.clear();
}
if (!ec && (wait_res == 0))
{
needs_post = false;
static int res[1] = {0};
if (descriptor.is_open())
descriptor.async_wait(
BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::descriptor_base::wait_read,
BOOST_PROCESS_V2_ASIO_NAMESPACE::posix::stream_descriptor::wait_read,
std::move(self));
else
handle.async_wait(std::move(self));

View File

@@ -101,7 +101,7 @@ test-suite with-valgrind :
[ run group.cpp system thread filesystem : [ test-options group ] : sub_launch ]
[ run group.cpp system thread filesystem : [ test-options group ] : sub_launch : <build>no <target-os>windows:<build>yes <define>BOOST_USE_WINDOWS_H=1 : group-windows-h ]
[ run group_wait.cpp system thread filesystem : [ test-options group_wait ] : sparring_partner : <target-os>darwin:<build>no ]
[ run limit_fd.cpp program_options system filesystem : [ test-options limit_fd ] : sparring_partner : <target-os>freebsd:<build>no ]
[ run limit_fd.cpp program_options system filesystem : [ test-options limit_fd ] : sparring_partner ]
[ run run_exe.cpp filesystem : : sparring_partner ]
[ run run_exe_path.cpp filesystem : [ test-options run_exe_path ] : sparring_partner ]
[ run search_path.cpp filesystem system : [ test-options search_path ] : : <target-os>windows:<source>shell32 ]

View File

@@ -16,7 +16,7 @@
#include <boost/asio.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/scope_exit.hpp>
#include <boost/process/error.hpp>
#include <boost/process/io.hpp>
#include <boost/process/args.hpp>
@@ -45,10 +45,6 @@ BOOST_AUTO_TEST_CASE(wait_group_test, *boost::unit_test::timeout(5))
BOOST_REQUIRE(done.load());
}};
BOOST_SCOPE_EXIT_ALL(&) {
done.store(true);
thr.join();
};
using boost::unit_test::framework::master_test_suite;
@@ -82,6 +78,9 @@ BOOST_AUTO_TEST_CASE(wait_group_test, *boost::unit_test::timeout(5))
BOOST_CHECK(!c1.running());
BOOST_CHECK(!c2.running());
done.store(true);
thr.join();
}

View File

@@ -40,7 +40,7 @@ BOOST_AUTO_TEST_CASE(wait_for)
BOOST_CHECK(!c.wait_for(std::chrono::milliseconds(200)));
BOOST_CHECK( c.wait_for(std::chrono::milliseconds(2000)));
BOOST_CHECK( c.wait_for(std::chrono::milliseconds(1000)));
auto timeout_t = std::chrono::system_clock::now();