From 0b03ae1a13bc9cfde43298e13fc573f5dd8b4726 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Thu, 22 Jan 2026 16:22:41 +0100 Subject: [PATCH] libutil: remove unused Pid::{killSignal, setKillSignal} Change-Id: Ic7cceef2d82a98cf8fe23260603b1262c097cad4 --- lix/libutil/processes.cc | 14 +++----------- lix/libutil/processes.hh | 3 --- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/lix/libutil/processes.cc b/lix/libutil/processes.cc index 14bdd5e8f..e0d891d73 100644 --- a/lix/libutil/processes.cc +++ b/lix/libutil/processes.cc @@ -13,6 +13,7 @@ #include "sync.hh" #include +#include #include #include #include @@ -41,8 +42,7 @@ Pid::Pid() { } - -Pid::Pid(Pid && other) : pid(other.pid), separatePG(other.separatePG), killSignal(other.killSignal) +Pid::Pid(Pid && other) : pid(other.pid), separatePG(other.separatePG) { other.pid = -1; } @@ -53,7 +53,6 @@ Pid & Pid::operator=(Pid && other) Pid tmp(std::move(other)); std::swap(pid, tmp.pid); std::swap(separatePG, tmp.separatePG); - std::swap(killSignal, tmp.killSignal); return *this; } @@ -73,7 +72,7 @@ int Pid::kill() /* Send the requested signal to the child. If it has its own process group, send the signal to every process in the child process group (which hopefully includes *all* its children). */ - if (::kill(separatePG ? -pid : pid, killSignal) != 0) { + if (::kill(separatePG ? -pid : pid, SIGKILL) != 0) { /* On BSDs, killing a process group will return EPERM if all processes in the group are zombies (or something like that). So try to detect and ignore that situation. */ @@ -109,13 +108,6 @@ void Pid::setSeparatePG(bool separatePG) this->separatePG = separatePG; } - -void Pid::setKillSignal(int signal) -{ - this->killSignal = signal; -} - - pid_t Pid::release() { pid_t p = pid; diff --git a/lix/libutil/processes.hh b/lix/libutil/processes.hh index 2af441791..5dd225303 100644 --- a/lix/libutil/processes.hh +++ b/lix/libutil/processes.hh @@ -12,7 +12,6 @@ #include #include #include -#include #include #include @@ -27,7 +26,6 @@ class Pid { pid_t pid = -1; bool separatePG = false; - int killSignal = SIGKILL; public: Pid(); explicit Pid(pid_t pid): pid(pid) {} @@ -39,7 +37,6 @@ public: int wait(); void setSeparatePG(bool separatePG); - void setKillSignal(int signal); pid_t release(); pid_t get() const { return pid; } };