mirror of
https://github.com/boostorg/process.git
synced 2026-01-19 16:32:15 +00:00
Compare commits
29 Commits
asio_no_de
...
boost-1.68
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44162ecf22 | ||
|
|
d709c1cd07 | ||
|
|
90d2c0ceca | ||
|
|
9549ffe7e1 | ||
|
|
dd0edb4aee | ||
|
|
3029f4623a | ||
|
|
74606db379 | ||
|
|
81803868a3 | ||
|
|
eff42f91ef | ||
|
|
a25b6ca35b | ||
|
|
1c8323650d | ||
|
|
52f030a83c | ||
|
|
9cc651bdeb | ||
|
|
128cb0283d | ||
|
|
bb259f8f16 | ||
|
|
bb1bb431e5 | ||
|
|
41b7e30c18 | ||
|
|
f1c6909eb0 | ||
|
|
35fda5aa6a | ||
|
|
1f7f805858 | ||
|
|
d47b7f7ac4 | ||
|
|
2bc2531d2a | ||
|
|
c5798fdf7f | ||
|
|
5e43e7c07c | ||
|
|
4fc4784506 | ||
|
|
900aab5d6d | ||
|
|
f61a61cf59 | ||
|
|
9f6c338631 | ||
|
|
c4ffd0c18d |
@@ -296,7 +296,7 @@ provided we also pass a reference to an io_service.
|
||||
|
||||
```
|
||||
io_service ios;
|
||||
std::vector<char> buf;
|
||||
std::vector<char> buf(4096);
|
||||
|
||||
bp::child c(bp::search_path("g++"), "main.cpp", bp::std_out > asio_buffer(buf), ios);
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ struct async_system_handler : ::boost::process::detail::api::async_handler
|
||||
{
|
||||
#if defined(BOOST_POSIX_API)
|
||||
if (errored)
|
||||
return [](int exit_code, const std::error_code & ec){};
|
||||
return [](int , const std::error_code &){};
|
||||
#endif
|
||||
auto & h = init.completion_handler;
|
||||
return [h](int exit_code, const std::error_code & ec) mutable
|
||||
|
||||
@@ -39,7 +39,7 @@ struct async_in_buffer : ::boost::process::detail::posix::handler_base_ext,
|
||||
{
|
||||
}
|
||||
template <typename Executor>
|
||||
inline void on_success(Executor &exec)
|
||||
inline void on_success(Executor)
|
||||
{
|
||||
auto pipe = this->pipe;
|
||||
if (this->promise)
|
||||
@@ -60,7 +60,7 @@ struct async_in_buffer : ::boost::process::detail::posix::handler_base_ext,
|
||||
}
|
||||
else
|
||||
boost::asio::async_write(*pipe, buf,
|
||||
[pipe](const boost::system::error_code&ec, std::size_t size){});
|
||||
[pipe](const boost::system::error_code&, std::size_t){});
|
||||
|
||||
std::move(*pipe).source().close();
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ struct async_out_buffer : ::boost::process::detail::posix::handler_base_ext,
|
||||
{
|
||||
auto pipe = this->pipe;
|
||||
boost::asio::async_read(*pipe, buf,
|
||||
[pipe](const boost::system::error_code&, std::size_t size){});
|
||||
[pipe](const boost::system::error_code&, std::size_t){});
|
||||
|
||||
this->pipe = nullptr;
|
||||
std::move(*pipe).sink().close();
|
||||
@@ -112,7 +112,7 @@ struct async_out_future : ::boost::process::detail::posix::handler_base_ext,
|
||||
fut = promise->get_future();
|
||||
}
|
||||
template <typename Executor>
|
||||
inline void on_success(Executor &exec)
|
||||
inline void on_success(Executor &)
|
||||
{
|
||||
auto pipe = this->pipe;
|
||||
|
||||
@@ -120,7 +120,7 @@ struct async_out_future : ::boost::process::detail::posix::handler_base_ext,
|
||||
auto promise = this->promise;
|
||||
|
||||
boost::asio::async_read(*pipe, *buffer,
|
||||
[pipe, buffer, promise](const boost::system::error_code& ec, std::size_t size)
|
||||
[pipe, buffer, promise](const boost::system::error_code& ec, std::size_t)
|
||||
{
|
||||
if (ec && (ec.value() != ENOENT))
|
||||
{
|
||||
|
||||
@@ -125,6 +125,18 @@ public:
|
||||
return _sink.write_some(buffers);
|
||||
}
|
||||
|
||||
template<typename MutableBufferSequence>
|
||||
std::size_t read_some(const MutableBufferSequence & buffers, boost::system::error_code & ec) noexcept
|
||||
{
|
||||
return _source.read_some(buffers, ec);
|
||||
}
|
||||
template<typename MutableBufferSequence>
|
||||
std::size_t write_some(const MutableBufferSequence & buffers, boost::system::error_code & ec) noexcept
|
||||
{
|
||||
return _sink.write_some(buffers, ec);
|
||||
}
|
||||
|
||||
|
||||
native_handle_type native_source() const {return const_cast<boost::asio::posix::stream_descriptor&>(_source).native_handle();}
|
||||
native_handle_type native_sink () const {return const_cast<boost::asio::posix::stream_descriptor&>(_sink ).native_handle();}
|
||||
|
||||
@@ -136,7 +148,7 @@ public:
|
||||
const MutableBufferSequence & buffers,
|
||||
ReadHandler &&handler)
|
||||
{
|
||||
_source.async_read_some(buffers, std::forward<ReadHandler>(handler));
|
||||
return _source.async_read_some(buffers, std::forward<ReadHandler>(handler));
|
||||
}
|
||||
|
||||
template<typename ConstBufferSequence,
|
||||
@@ -147,7 +159,7 @@ public:
|
||||
const ConstBufferSequence & buffers,
|
||||
WriteHandler&& handler)
|
||||
{
|
||||
_sink.async_write_some(buffers, std::forward<WriteHandler>(handler));
|
||||
return _sink.async_write_some(buffers, std::forward<WriteHandler>(handler));
|
||||
}
|
||||
|
||||
|
||||
@@ -238,8 +250,8 @@ async_pipe& async_pipe::operator=(const async_pipe & p)
|
||||
int sink;
|
||||
|
||||
//cannot get the handle from a const object.
|
||||
auto source_in = const_cast<::boost::asio::posix::stream_descriptor &>(_source).native_handle();
|
||||
auto sink_in = const_cast<::boost::asio::posix::stream_descriptor &>(_sink).native_handle();
|
||||
auto source_in = const_cast<::boost::asio::posix::stream_descriptor &>(p._source).native_handle();
|
||||
auto sink_in = const_cast<::boost::asio::posix::stream_descriptor &>(p._sink).native_handle();
|
||||
if (source_in == -1)
|
||||
source = -1;
|
||||
else
|
||||
|
||||
@@ -56,7 +56,7 @@ struct group_handle
|
||||
{
|
||||
return ::getpgid(proc) == grp;
|
||||
}
|
||||
bool has(handle_t proc, std::error_code & ec) noexcept
|
||||
bool has(handle_t proc, std::error_code &) noexcept
|
||||
{
|
||||
return ::getpgid(proc) == grp;
|
||||
}
|
||||
|
||||
@@ -104,8 +104,7 @@ void sigchld_service::_handle_signal(const boost::system::error_code & ec)
|
||||
_signal_set.async_wait(
|
||||
[this](const boost::system::error_code & ec, int)
|
||||
{
|
||||
_strand.post([ec]{});
|
||||
this->_handle_signal(ec);
|
||||
_strand.post([this, ec]{this->_handle_signal(ec);});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ template< class Clock, class Duration >
|
||||
inline bool wait_until(
|
||||
const child_handle &p,
|
||||
int & exit_code,
|
||||
const std::chrono::time_point<Clock, Duration>& time_out) noexcept
|
||||
const std::chrono::time_point<Clock, Duration>& time_out)
|
||||
{
|
||||
std::error_code ec;
|
||||
bool b = wait_until(p, exit_code, time_out, ec);
|
||||
@@ -109,7 +109,7 @@ template< class Rep, class Period >
|
||||
inline bool wait_for(
|
||||
const child_handle &p,
|
||||
int & exit_code,
|
||||
const std::chrono::duration<Rep, Period>& rel_time) noexcept
|
||||
const std::chrono::duration<Rep, Period>& rel_time)
|
||||
{
|
||||
std::error_code ec;
|
||||
bool b = wait_for(p, exit_code, rel_time, ec);
|
||||
|
||||
@@ -144,6 +144,18 @@ public:
|
||||
return _sink.write_some(buffers);
|
||||
}
|
||||
|
||||
|
||||
template<typename MutableBufferSequence>
|
||||
std::size_t read_some(const MutableBufferSequence & buffers, boost::system::error_code & ec) noexcept
|
||||
{
|
||||
return _source.read_some(buffers, ec);
|
||||
}
|
||||
template<typename MutableBufferSequence>
|
||||
std::size_t write_some(const MutableBufferSequence & buffers, boost::system::error_code & ec) noexcept
|
||||
{
|
||||
return _sink.write_some(buffers, ec);
|
||||
}
|
||||
|
||||
native_handle_type native_source() const {return const_cast<boost::asio::windows::stream_handle&>(_source).native_handle();}
|
||||
native_handle_type native_sink () const {return const_cast<boost::asio::windows::stream_handle&>(_sink ).native_handle();}
|
||||
|
||||
@@ -155,7 +167,7 @@ public:
|
||||
const MutableBufferSequence & buffers,
|
||||
ReadHandler &&handler)
|
||||
{
|
||||
_source.async_read_some(buffers, std::forward<ReadHandler>(handler));
|
||||
return _source.async_read_some(buffers, std::forward<ReadHandler>(handler));
|
||||
}
|
||||
|
||||
template<typename ConstBufferSequence,
|
||||
@@ -166,7 +178,7 @@ public:
|
||||
const ConstBufferSequence & buffers,
|
||||
WriteHandler && handler)
|
||||
{
|
||||
_sink.async_write_some(buffers, std::forward<WriteHandler>(handler));
|
||||
return _sink.async_write_some(buffers, std::forward<WriteHandler>(handler));
|
||||
}
|
||||
|
||||
const handle_type & sink () const & {return _sink;}
|
||||
|
||||
@@ -82,7 +82,7 @@ typedef struct _JOBOBJECT_EXTENDED_LIMIT_INFORMATION_ {
|
||||
_Out_opt_ LPDWORD lpReturnLength
|
||||
);
|
||||
*/
|
||||
typedef ::boost::winapi::BOOL_ ( WINAPI *query_information_job_object_p)(
|
||||
typedef ::boost::winapi::BOOL_ (*query_information_job_object_p)(
|
||||
::boost::winapi::HANDLE_,
|
||||
JOBOBJECTINFOCLASS_,
|
||||
void *,
|
||||
@@ -90,7 +90,7 @@ typedef ::boost::winapi::BOOL_ ( WINAPI *query_information_job_object_p)(
|
||||
::boost::winapi::DWORD_ *);
|
||||
|
||||
|
||||
inline ::boost::winapi::BOOL_ WINAPI query_information_job_object(
|
||||
inline ::boost::winapi::BOOL_ query_information_job_object(
|
||||
::boost::winapi::HANDLE_ hJob,
|
||||
JOBOBJECTINFOCLASS_ JobObjectInfoClass,
|
||||
void * lpJobObjectInfo,
|
||||
@@ -110,7 +110,7 @@ inline ::boost::winapi::BOOL_ WINAPI query_information_job_object(
|
||||
_In_ DWORD cbJobObjectInfoLength
|
||||
);*/
|
||||
|
||||
typedef ::boost::winapi::BOOL_ ( WINAPI *set_information_job_object_p)(
|
||||
typedef ::boost::winapi::BOOL_ (*set_information_job_object_p)(
|
||||
::boost::winapi::HANDLE_,
|
||||
JOBOBJECTINFOCLASS_,
|
||||
void *,
|
||||
@@ -118,7 +118,7 @@ typedef ::boost::winapi::BOOL_ ( WINAPI *set_information_job_object_p)(
|
||||
|
||||
}
|
||||
|
||||
inline ::boost::winapi::BOOL_ WINAPI set_information_job_object(
|
||||
inline ::boost::winapi::BOOL_ set_information_job_object(
|
||||
::boost::winapi::HANDLE_ hJob,
|
||||
JOBOBJECTINFOCLASS_ JobObjectInfoClass,
|
||||
void * lpJobObjectInfo,
|
||||
|
||||
@@ -55,9 +55,9 @@ inline boost::filesystem::path search_path(
|
||||
for (auto & ext : extensions)
|
||||
boost::to_lower(ext);
|
||||
|
||||
for (const boost::filesystem::path & pp : path)
|
||||
for (const boost::filesystem::path & pp_ : path)
|
||||
{
|
||||
auto p = pp / filename;
|
||||
auto p = pp_ / filename;
|
||||
for (boost::filesystem::path ext : extensions)
|
||||
{
|
||||
boost::filesystem::path pp = p;
|
||||
|
||||
@@ -34,7 +34,7 @@ struct create_no_window_ : public ::boost::process::detail::handler_base
|
||||
template <class Executor>
|
||||
void on_setup(Executor &exec) const
|
||||
{
|
||||
exec.creation_flags |= ::boost::detail::winapi::CREATE_NO_WINDOW_;
|
||||
exec.creation_flags |= ::boost::winapi::CREATE_NO_WINDOW_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -94,8 +94,8 @@ struct entry : const_entry<Char, Environment>
|
||||
explicit entry(string_type&& name, pointer data, environment_t & env) :
|
||||
father(std::move(name), data, env) {}
|
||||
|
||||
explicit entry(string_type &&name, environment_t & env) :
|
||||
father(std::move(name), env) {}
|
||||
explicit entry(string_type &&name, environment_t & env_) :
|
||||
father(std::move(name), env_) {}
|
||||
|
||||
entry(const entry&) = default;
|
||||
entry& operator=(const entry&) = default;
|
||||
|
||||
@@ -26,10 +26,28 @@ namespace boost {
|
||||
</programlisting>
|
||||
\endxmlonly
|
||||
*/
|
||||
namespace boost { namespace process { namespace detail {
|
||||
namespace boost {
|
||||
namespace filesystem { class path; }
|
||||
|
||||
namespace process {
|
||||
|
||||
namespace detail {
|
||||
|
||||
struct exe_
|
||||
{
|
||||
template<typename = void>
|
||||
inline exe_setter_<typename boost::filesystem::path::value_type> operator()(const boost::filesystem::path & pth) const
|
||||
{
|
||||
return exe_setter_<typename boost::filesystem::path::value_type>(pth.native());
|
||||
}
|
||||
|
||||
template<typename = void>
|
||||
inline exe_setter_<typename boost::filesystem::path::value_type> operator=(const boost::filesystem::path & pth) const
|
||||
{
|
||||
return exe_setter_<typename boost::filesystem::path::value_type>(pth.native());
|
||||
}
|
||||
|
||||
|
||||
template<typename Char>
|
||||
inline exe_setter_<Char> operator()(const Char *s) const
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user