summaryrefslogtreecommitdiff
path: root/boost/process/detail/posix/async_in.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/process/detail/posix/async_in.hpp')
-rw-r--r--boost/process/detail/posix/async_in.hpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/boost/process/detail/posix/async_in.hpp b/boost/process/detail/posix/async_in.hpp
index 1c1e2f40fb..7e9fb94ebd 100644
--- a/boost/process/detail/posix/async_in.hpp
+++ b/boost/process/detail/posix/async_in.hpp
@@ -85,7 +85,9 @@ struct async_in_buffer : ::boost::process::detail::posix::handler_base_ext,
if (::dup2(pipe->native_source(), STDIN_FILENO) == -1)
exec.set_error(::boost::process::detail::get_last_error(), "dup2() failed");
- ::close(pipe->native_source());
+ if (pipe->native_source() != STDIN_FILENO)
+ ::close(pipe->native_source());
+ ::close(pipe->native_sink());
}
};