Skip to content

Commit

Permalink
removed boost::system:: scope spec for error_code.
Browse files Browse the repository at this point in the history
  • Loading branch information
klemens-morgenstern committed Dec 20, 2024
1 parent d75ffb3 commit b529769
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 87 deletions.
2 changes: 1 addition & 1 deletion include/boost/process/v2/detail/process_handle_windows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ struct basic_process_handle_win
sl.assign(
[&h](asio::cancellation_type ct)
{
boost::system::error_code ec;
error_code ec;
h.cancel(ec);
});
handle.async_wait(std::move(self));
Expand Down
4 changes: 2 additions & 2 deletions include/boost/process/v2/ext/detail/proc_info.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ typedef struct {
#else
#include <poppack.h>
#endif
BOOST_PROCESS_V2_DECL std::wstring cwd_cmd_from_proc(HANDLE proc, int type, boost::system::error_code & ec);
BOOST_PROCESS_V2_DECL HANDLE open_process_with_debug_privilege(boost::process::v2::pid_type pid, boost::system::error_code & ec);
BOOST_PROCESS_V2_DECL std::wstring cwd_cmd_from_proc(HANDLE proc, int type, error_code & ec);
BOOST_PROCESS_V2_DECL HANDLE open_process_with_debug_privilege(boost::process::v2::pid_type pid, error_code & ec);
#endif

} // namespace ext
Expand Down
6 changes: 3 additions & 3 deletions include/boost/process/v2/pid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ constexpr static pid_type root_pid = 1;
BOOST_PROCESS_V2_DECL pid_type current_pid();

/// List all available pids.
BOOST_PROCESS_V2_DECL std::vector<pid_type> all_pids(boost::system::error_code & ec);
BOOST_PROCESS_V2_DECL std::vector<pid_type> all_pids(error_code & ec);

/// List all available pids.
BOOST_PROCESS_V2_DECL std::vector<pid_type> all_pids();

// return parent pid of pid.
BOOST_PROCESS_V2_DECL pid_type parent_pid(pid_type pid, boost::system::error_code & ec);
BOOST_PROCESS_V2_DECL pid_type parent_pid(pid_type pid, error_code & ec);

// return parent pid of pid.
BOOST_PROCESS_V2_DECL pid_type parent_pid(pid_type pid);

// return child pids of pid.
BOOST_PROCESS_V2_DECL std::vector<pid_type> child_pids(pid_type pid, boost::system::error_code & ec);
BOOST_PROCESS_V2_DECL std::vector<pid_type> child_pids(pid_type pid, error_code & ec);

// return child pids of pid.
BOOST_PROCESS_V2_DECL std::vector<pid_type> child_pids(pid_type pid);
Expand Down
20 changes: 10 additions & 10 deletions include/boost/process/v2/popen.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ struct basic_popen : basic_process<Executor>
*
* @returns The number of bytes written.
*
* @throws boost::system::system_error Thrown on failure. An error code of
* @throws system_error Thrown on failure. An error code of
* boost::asio::error::eof indicates that the connection was closed by the
* subprocess.
*
Expand Down Expand Up @@ -289,7 +289,7 @@ struct basic_popen : basic_process<Executor>
*/
template <typename ConstBufferSequence>
std::size_t write_some(const ConstBufferSequence& buffers,
boost::system::error_code& ec)
error_code& ec)
{
return stdin_.write_some(buffers, ec);
}
Expand All @@ -311,7 +311,7 @@ struct basic_popen : basic_process<Executor>
* @ref yield_context, or a function object with the correct completion
* signature. The function signature of the completion handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* const error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes written.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
Expand All @@ -320,7 +320,7 @@ struct basic_popen : basic_process<Executor>
* manner equivalent to using boost::asio::post().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
* @code void(error_code, std::size_t) @endcode
*
* @note The write operation may not transmit all of the data to the peer.
* Consider using the @ref async_write function if you need to ensure that all
Expand All @@ -336,7 +336,7 @@ struct basic_popen : basic_process<Executor>
* std::vector.
*/
template <typename ConstBufferSequence,
BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(void (boost::system::error_code, std::size_t))
BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(void (error_code, std::size_t))
WriteToken = net::default_completion_token_t<executor_type>>
auto async_write_some(const ConstBufferSequence& buffers,
WriteToken && token = net::default_completion_token_t<executor_type>())
Expand All @@ -356,7 +356,7 @@ struct basic_popen : basic_process<Executor>
*
* @returns The number of bytes read.
*
* @throws boost::system::system_error Thrown on failure. An error code of
* @throws system_error Thrown on failure. An error code of
* boost::asio::error::eof indicates that the connection was closed by the
* peer.
*
Expand Down Expand Up @@ -399,7 +399,7 @@ struct basic_popen : basic_process<Executor>
*/
template <typename MutableBufferSequence>
std::size_t read_some(const MutableBufferSequence& buffers,
boost::system::error_code& ec)
error_code& ec)
{
return stdout_.read_some(buffers, ec);
}
Expand All @@ -421,7 +421,7 @@ struct basic_popen : basic_process<Executor>
* @ref yield_context, or a function object with the correct completion
* signature. The function signature of the completion handler must be:
* @code void handler(
* const boost::system::error_code& error, // Result of operation.
* const error_code& error, // Result of operation.
* std::size_t bytes_transferred // Number of bytes read.
* ); @endcode
* Regardless of whether the asynchronous operation completes immediately or
Expand All @@ -430,7 +430,7 @@ struct basic_popen : basic_process<Executor>
* manner equivalent to using boost::asio::post().
*
* @par Completion Signature
* @code void(boost::system::error_code, std::size_t) @endcode
* @code void(error_code, std::size_t) @endcode
*
* @note The read operation may not read all of the requested number of bytes.
* Consider using the @ref async_read function if you need to ensure that the
Expand All @@ -448,7 +448,7 @@ struct basic_popen : basic_process<Executor>
* std::vector.
*/
template <typename MutableBufferSequence,
BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(void (boost::system::error_code, std::size_t))
BOOST_PROCESS_V2_COMPLETION_TOKEN_FOR(void (error_code, std::size_t))
ReadToken = net::default_completion_token_t<executor_type>>
auto async_read_some(const MutableBufferSequence& buffers,
BOOST_ASIO_MOVE_ARG(ReadToken) token
Expand Down
20 changes: 10 additions & 10 deletions src/ext/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,14 @@ shell cmd(HANDLE proc, error_code & ec)

shell cmd(HANDLE proc)
{
boost::system::error_code ec;
error_code ec;
auto res = cmd(proc, ec);
if (ec)
detail::throw_error(ec, "cmd");
return res;
}

shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
shell cmd(boost::process::v2::pid_type pid, error_code & ec)
{
struct del
{
Expand All @@ -162,7 +162,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)

#elif (defined(__APPLE__) && defined(__MACH__)) && !TARGET_OS_IOS

shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
shell cmd(boost::process::v2::pid_type pid, error_code & ec)
{
int mib[3] = {CTL_KERN, KERN_ARGMAX, 0};
int argmax = 0;
Expand Down Expand Up @@ -213,7 +213,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)

#elif (defined(__linux__) || defined(__ANDROID__))

shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
shell cmd(boost::process::v2::pid_type pid, error_code & ec)
{
std::string procargs;
procargs.resize(4096);
Expand Down Expand Up @@ -269,7 +269,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)

#elif (defined(__FreeBSD__) || defined(__DragonFly__))

shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
shell cmd(boost::process::v2::pid_type pid, error_code & ec)
{
int cntp = 0;
kinfo_proc *proc_info = nullptr;
Expand Down Expand Up @@ -301,7 +301,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)

#elif defined(__NetBSD__)

shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
shell cmd(boost::process::v2::pid_type pid, error_code & ec)
{
int cntp = 0;
kinfo_proc2 *proc_info = nullptr;
Expand Down Expand Up @@ -332,7 +332,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)

#elif defined(__OpenBSD__)

shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
shell cmd(boost::process::v2::pid_type pid, error_code & ec)
{
int cntp = 0;
kinfo_proc *proc_info = nullptr;
Expand Down Expand Up @@ -362,7 +362,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)

#elif defined(__sun)

shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
shell cmd(boost::process::v2::pid_type pid, error_code & ec)
{
char **cmd = nullptr;
proc *proc_info = nullptr;
Expand Down Expand Up @@ -403,7 +403,7 @@ shell cmd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
}

#else
filesystem::path cmd(boost::process::v2::pid_type, boost::system::error_code & ec)
filesystem::path cmd(boost::process::v2::pid_type, error_code & ec)
{
BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category());
return "";
Expand All @@ -412,7 +412,7 @@ filesystem::path cmd(boost::process::v2::pid_type, boost::system::error_code & e

shell cmd(boost::process::v2::pid_type pid)
{
boost::system::error_code ec;
error_code ec;
auto res = cmd(pid, ec);
if (ec)
detail::throw_error(ec, "cmd");
Expand Down
20 changes: 10 additions & 10 deletions src/ext/cwd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace ext {

#if defined(BOOST_PROCESS_V2_WINDOWS)

filesystem::path cwd(HANDLE proc, boost::system::error_code & ec)
filesystem::path cwd(HANDLE proc, error_code & ec)
{
auto buffer = boost::process::v2::detail::ext::cwd_cmd_from_proc(proc, 1/*=MEMCWD*/, ec);
if (!buffer.empty())
Expand All @@ -77,7 +77,7 @@ filesystem::path cwd(HANDLE proc, boost::system::error_code & ec)
return "";
}

filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec)
{
struct del
{
Expand All @@ -96,7 +96,7 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code

filesystem::path cwd(HANDLE proc)
{
boost::system::error_code ec;
error_code ec;
auto res = cwd(proc, ec);
if (ec)
detail::throw_error(ec, "cwd");
Expand All @@ -105,7 +105,7 @@ filesystem::path cwd(HANDLE proc)

#elif (defined(__APPLE__) && defined(__MACH__)) && !TARGET_OS_IOS

filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec)
{
proc_vnodepathinfo vpi;
if (proc_pidinfo(pid, PROC_PIDVNODEPATHINFO, 0, &vpi, sizeof(vpi)) > 0)
Expand All @@ -117,7 +117,7 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code

#elif (defined(__linux__) || defined(__ANDROID__) || defined(__sun))

filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec)
{
#if (defined(__linux__) || defined(__ANDROID__))
return filesystem::canonical(
Expand All @@ -132,7 +132,7 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code

#elif defined(__FreeBSD__)

filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec)
{
filesystem::path path;
struct kinfo_file kif;
Expand All @@ -155,7 +155,7 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code

#elif defined(__DragonFly__)

filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec)
{
filesystem::path path;
char buffer[PATH_MAX];
Expand All @@ -172,7 +172,7 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code

#elif (defined(__NetBSD__) || defined(__OpenBSD__))

filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec)
{
filesystem::path path;
#if defined(__NetBSD__)
Expand Down Expand Up @@ -200,7 +200,7 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code
}

#else
filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec)
filesystem::path cwd(boost::process::v2::pid_type pid, error_code & ec)
{
BOOST_PROCESS_V2_ASSIGN_EC(ec, ENOTSUP, system_category());
return "";
Expand All @@ -209,7 +209,7 @@ 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;
error_code ec;
auto res = cwd(pid, ec);
if (ec)
detail::throw_error(ec, "cwd");
Expand Down
Loading

0 comments on commit b529769

Please sign in to comment.