aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2024-04-16 12:53:07 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2024-04-16 14:25:00 +0200
commit62db8f8e5a6cfe19d905afc91731d6bc8a665f61 (patch)
tree343542375a159659bfbd9a2a06408b174d41c02f /src/util
parent80d008c66d00d3496cd8549daee6775cf2c6b782 (diff)
downloadbitcoin-62db8f8e5a6cfe19d905afc91731d6bc8a665f61.tar.xz
remove unneeded session_leader option from cpp-subprocess
Diffstat (limited to 'src/util')
-rw-r--r--src/util/subprocess.hpp25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/util/subprocess.hpp b/src/util/subprocess.hpp
index dd0789b72c..56f17c771f 100644
--- a/src/util/subprocess.hpp
+++ b/src/util/subprocess.hpp
@@ -656,17 +656,6 @@ struct close_fds {
};
/*!
- * Option to make the child process as the
- * session leader and thus the process
- * group leader.
- * Default value is false.
- */
-struct session_leader {
- explicit session_leader(bool sl): leader_(sl) {}
- bool leader_ = false;
-};
-
-/*!
* Base class for all arguments involving string value.
*/
struct string_arg
@@ -941,7 +930,6 @@ struct ArgumentDeducer
void set_option(output&& out);
void set_option(error&& err);
void set_option(close_fds&& cfds);
- void set_option(session_leader&& sleader);
private:
Popen* popen_ = nullptr;
@@ -1268,7 +1256,6 @@ private:
#endif
bool close_fds_ = false;
- bool session_leader_ = false;
std::string exe_name_;
std::string cwd_;
@@ -1385,8 +1372,7 @@ inline void Popen::kill(int sig_num)
throw OSError("TerminateProcess", 0);
}
#else
- if (session_leader_) killpg(child_pid_, sig_num);
- else ::kill(child_pid_, sig_num);
+ ::kill(child_pid_, sig_num);
#endif
}
@@ -1564,10 +1550,6 @@ namespace detail {
popen_->env_ = std::move(env.env_);
}
- inline void ArgumentDeducer::set_option(session_leader&& sleader) {
- popen_->session_leader_ = sleader.leader_;
- }
-
inline void ArgumentDeducer::set_option(input&& inp) {
if (inp.rd_ch_ != -1) popen_->stream_.read_from_parent_ = inp.rd_ch_;
if (inp.wr_ch_ != -1) popen_->stream_.write_to_child_ = inp.wr_ch_;
@@ -1657,11 +1639,6 @@ namespace detail {
if (sys_ret == -1) throw OSError("chdir failed", errno);
}
- if (parent_->session_leader_) {
- sys_ret = setsid();
- if (sys_ret == -1) throw OSError("setsid failed", errno);
- }
-
// Replace the current image with the executable
if (parent_->env_.size()) {
for (auto& kv : parent_->env_) {