From ff198b5ce559a27ce55bbd0f6eb8f0cadc919ba8 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Thu, 29 Aug 2024 20:05:50 +0000 Subject: [PATCH] run_command: Enable close_fds option to avoid lingering fds --- src/common/run_command.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/run_command.cpp b/src/common/run_command.cpp index 67608b985f..16fece02f0 100644 --- a/src/common/run_command.cpp +++ b/src/common/run_command.cpp @@ -24,7 +24,7 @@ UniValue RunCommandParseJSON(const std::string& str_command, const std::string& if (str_command.empty()) return UniValue::VNULL; - auto c = sp::Popen(str_command, sp::input{sp::PIPE}, sp::output{sp::PIPE}, sp::error{sp::PIPE}); + auto c = sp::Popen(str_command, sp::input{sp::PIPE}, sp::output{sp::PIPE}, sp::error{sp::PIPE}, sp::close_fds{true}); if (!str_std_in.empty()) { c.send(str_std_in); }