libutil: remove unused Pid::{killSignal, setKillSignal}
Change-Id: Ic7cceef2d82a98cf8fe23260603b1262c097cad4
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "sync.hh"
|
||||
|
||||
#include <cerrno>
|
||||
#include <csignal>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include <fcntl.h>
|
||||
@@ -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;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <functional>
|
||||
#include <map>
|
||||
@@ -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; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user