Skip to content

Commit

Permalink
fixed missing return.
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Jul 2, 2024
1 parent ceec542 commit c2589b1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion include/boost/process/v1/environment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ class basic_environment_impl : public Implementation<Char>
auto st1 = key + ::boost::process::v1::detail::equal_sign<Char>();
while (*p != nullptr)
{
const std::size_t len = std::char_traits<Char>::length(*p);
const std::ptrdiff_t len = std::char_traits<Char>::length(*p);
if ((std::distance(st1.begin(), st1.end()) < len)
&& std::equal(st1.begin(), st1.end(), *p))
break;
Expand Down
2 changes: 1 addition & 1 deletion include/boost/process/v2/detail/process_handle_fd.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ struct basic_process_handle_fd
{
ec.clear();
exit_code = code;
return false;
}
return false;
}

bool running(native_exit_code_type &exit_code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,9 @@ struct basic_process_handle_fd_or_signal
if (process_is_running(res))
return true;
else
{
exit_code = code;
return false;
}

return false;
}

bool running(native_exit_code_type &exit_code)
Expand Down
4 changes: 1 addition & 3 deletions include/boost/process/v2/detail/process_handle_signal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,8 @@ struct basic_process_handle_signal
if (res == 0)
return true;
else
{
exit_code = code;
return false;
}
return false;
}

bool running(native_exit_code_type &exit_code)
Expand Down
5 changes: 2 additions & 3 deletions include/boost/process/v2/detail/process_handle_windows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,9 @@ struct basic_process_handle_win
if (process_is_running(code))
return true;
else
{
exit_code = code;
return false;
}

return false;
}

bool running(native_exit_code_type &exit_code)
Expand Down
5 changes: 4 additions & 1 deletion test/v1/async_system_stackless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ BOOST_AUTO_TEST_CASE(stackless, *boost::unit_test::timeout(15))
boost::system::error_code ec = boost::system::error_code(),
std::size_t exit_code = 0)
{
if (!ec) reenter (this)
if (ec)
return;

reenter (this)
{
yield bp::async_system(
ios, *this,
Expand Down
2 changes: 1 addition & 1 deletion test/v2/ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ BOOST_AUTO_TEST_CASE(cmd_exe)
bp2::basic_cstring_ref<typename bp2::shell::char_type> ref(cm.argv()[0]);
BOOST_CHECK_EQUAL(bp2::detail::conv_string<char>(ref.data(), ref.size()), pth);

BOOST_REQUIRE_EQUAL(cm.argc(), args.size() + 1);
BOOST_REQUIRE_EQUAL(cm.argc(), args.size() + 1u);
for (auto i = 0u; i < args.size(); i++)
{
ref = cm.argv()[i + 1];
Expand Down
2 changes: 1 addition & 1 deletion test/v2/process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ BOOST_AUTO_TEST_CASE(popen)
// default CWD
bpv::popen proc(/*bpv::default_process_launcher(), */ctx, pth, {"echo"});

BOOST_CHECK_EQUAL(asio::write(proc, asio::buffer("FOOBAR", 6)), 6);
BOOST_CHECK_EQUAL(asio::write(proc, asio::buffer("FOOBAR", 6)), 6u);

proc.get_stdin().close();

Expand Down

0 comments on commit c2589b1

Please sign in to comment.