Skip to content

Commit

Permalink
fixup! cpp-subprocess: Iterate through /proc/self/fd for close_fds op…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
luke-jr committed Aug 29, 2024
1 parent 7fff94a commit 6a3967f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/subprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ namespace detail {
// Close all the inherited fd's except the error write pipe
if (parent_->close_fds_) {
try {
for (auto it : fs::directory_iterator("/proc/self/fd")) {
for (const auto& it : fs::directory_iterator("/proc/self/fd")) {
int64_t fd;
if (!ParseInt64(it.path().filename().native(), &fd)) continue;
if (fd <= 2) continue; // leave std{in,out,err} alone
Expand Down

0 comments on commit 6a3967f

Please sign in to comment.