Skip to content

Commit

Permalink
v2: fix closing of file descriptors
Browse files Browse the repository at this point in the history
Fix off-by-one error. Currently, no handles are actually closed.
  • Loading branch information
ceggers-arri authored and klemens-morgenstern committed Mar 28, 2024
1 parent 7689446 commit 7a17af0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/boost/process/v2/posix/detail/close_handles.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void close_all(const std::vector<int> & whitelist, error_code & ec)
idx++)
{
const auto mine = whitelist[idx];
const auto next = whitelist[idx];
const auto next = whitelist[idx + 1];
if ((mine + 1) != next && (mine != next))
{
::close_range(mine + 1, next - 1, 0);
Expand Down Expand Up @@ -132,7 +132,7 @@ void close_all(const std::vector<int> & whitelist, error_code & ec)
idx++)
{
const auto mine = whitelist[idx];
const auto next = whitelist[idx];
const auto next = whitelist[idx + 1];
if ((mine + 1) != next && (mine != next))
{
::close_range(mine + 1, next - 1, CLOSE_RANGE_UNSHARE);
Expand Down

0 comments on commit 7a17af0

Please sign in to comment.