From 6a3967f9889bec3ae0357c9a5636d4ede6e7cdfa Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 29 Aug 2024 21:13:04 +0000 Subject: [PATCH] fixup! cpp-subprocess: Iterate through /proc/self/fd for close_fds option --- src/util/subprocess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/subprocess.h b/src/util/subprocess.h index 2b2e8ba9df4fa6..e223f77c1bd74d 100644 --- a/src/util/subprocess.h +++ b/src/util/subprocess.h @@ -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