Open ceggers-arri opened 3 years ago
This is a bug. thanks for reporting.
@klemens-morgenstern also bug for async_pipe
... https://github.com/boostorg/process/blob/master/include/boost/process/detail/posix/pipe_out.hpp is also missing uses_handles
?
This commit https://github.com/boostorg/process/commit/f8c0dd4da58a2cf5db110d5a7e116adbe09f24a8 seems to have changes for pipe_out
... but this wasn't taken in the merge commit https://github.com/boostorg/process/commit/fa81cecffc16fc557a3b99bcf8ecb6a7c9825937 😞
I spotted a few other issues with limit_handles
implementation...
This seems to be an important typo, on_success
presumably intended:
This doc seems to be untrue (ah, already reported as https://github.com/boostorg/process/issues/212):
This doc is confusing:
I assume that's meant to be "sets all handles to be inherited only explicitly"?
This comment has a typo, get_used_handles
presumably intended:
Boost version: 1.72.0 Platform: Linux
I use
bp::limit_handles
in order to avoid leaking file descriptors to child processes. This works fine, but I was unsuccessful combining this with redirection ofstd_out
to astring
future
.In the second example, the
future
is valid, but thestring
is empty. When I removebp::limit_handles
,stdOut
contains"1\n"
.I recognized that there is a slight difference between
async_out_buffer
...... and
async_out_future
:While the former derives from
bp::detail::use_handles
(which seems to avoid closing this file descriptor), the latter doesn't do this.Is this a by intention or a bug? Is there a way redirecting
std_out
to astring
together with closing all other file handles?Side question: How can I determine the number of output bytes for the first example (with the vector)?
regards Christian