Skip to content

Commit 7491cc9

Browse files
minor fixes.
1 parent 5b5c67b commit 7491cc9

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

doc/Jamfile.jam

+5-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ doxygen reference_v1
3232
[ glob $(INCLUDES)/boost/process/v1/*.hpp ]
3333
:
3434
<doxygen:param>EXCLUDE_SYMBOLS=BOOST_ASIO_INITFN_RESULT_TYPE
35-
<doxygen:param>PREDEFINED=BOOST_PROCESS_DOXYGEN
35+
<doxygen:param>"PREDEFINED=\\
36+
BOOST_PROCESS_DOXYGEN=1 \\
37+
BOOST_PROCESS_V1_INLINE=
38+
"
3639
<doxygen:param>HIDE_UNDOC_CLASSES=YES
3740
<doxygen:param>HIDE_UNDOC_MEMBERS=YES
3841
<doxygen:param>EXAMPLE_PATH=.
@@ -67,6 +70,7 @@ doxygen reference_v2
6770
BOOST_ASIO_DEFAULT_COMPLETION_TOKEN=DEFAULT \\
6871
BOOST_CONSTEXPR=constexpr \\
6972
BOOST_CXX14_CONSTEXPR=constexpr \\
73+
BOOST_PROCESS_V2_INLINE= \\
7074
BOOST_ATTRIBUTE_NODISCARD=[[nodiscard]]
7175
"
7276
<doxygen.doxproc.id>reference_v2

include/boost/process/v2/impl/pid.ipp

+6-3
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,10 @@ pid_type parent_pid(pid_type pid, boost::system::error_code & ec)
216216
FILE *stat = fopen(buffer, "r");
217217
if (!stat)
218218
{
219-
BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec)
219+
if (errno == ENOENT)
220+
BOOST_PROCESS_V2_ASSIGN_EC(ec, ESRCH, system_category())
221+
else
222+
BOOST_PROCESS_V2_ASSIGN_LAST_ERROR(ec)
220223
return ppid;
221224
}
222225
else
@@ -260,9 +263,9 @@ std::vector<pid_type> child_pids(pid_type pid, boost::system::error_code & ec)
260263
{
261264
pid_type ppid = parent_pid(pids[i], ec);
262265
if (ppid != -1 && ppid == pid)
263-
{
264266
vec.push_back(pids[i]);
265-
}
267+
else if (ec.value() == ESRCH)
268+
ec.clear();
266269
}
267270
return vec;
268271
}

test/v2/pid.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ BOOST_AUTO_TEST_CASE(test_pid)
2929
BOOST_AUTO_TEST_CASE(child_pid)
3030
{
3131
namespace bp2 = boost::process::v2;
32-
3332
using boost::unit_test::framework::master_test_suite;
3433
const auto pth = bp2::filesystem::absolute(master_test_suite().argv[1]);
3534
std::this_thread::sleep_for(std::chrono::milliseconds(100));
@@ -48,7 +47,7 @@ BOOST_AUTO_TEST_CASE(child_pid)
4847
if (ec)
4948
BOOST_CHECK(ec == boost::system::errc::permission_denied);
5049
else
51-
proc.wait();
50+
proc.wait(ec);
5251

5352
auto c3 = bp2::child_pids(bp2::current_pid());
5453
BOOST_CHECK(std::find(c3.begin(), c3.end(), proc.id()) == c3.end());

test/v2/process.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,9 @@ BOOST_AUTO_TEST_CASE(terminate)
129129
bpv::process proc(ctx, pth, {"sleep", "10"});
130130
proc.suspend();
131131
proc.resume();
132-
proc.terminate();
133-
proc.wait();
132+
boost::system::error_code ec;
133+
proc.terminate(ec);
134+
proc.wait(ec);
134135
BOOST_CHECK_NE(proc.exit_code(), 0);
135136
}
136137

0 commit comments

Comments
 (0)