mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-12 12:14:36 +03:00
Refactor to remove no-op calls
This removes the call-sites of the removed setuid feature
This commit is contained in:
@ -479,10 +479,9 @@ bool Process_isTomb(const Process* this) {
|
||||
}
|
||||
|
||||
bool Process_setPriority(Process* this, int priority) {
|
||||
CRT_dropPrivileges();
|
||||
int old_prio = getpriority(PRIO_PROCESS, this->pid);
|
||||
int err = setpriority(PRIO_PROCESS, this->pid, priority);
|
||||
CRT_restorePrivileges();
|
||||
|
||||
if (err == 0 && old_prio != getpriority(PRIO_PROCESS, this->pid)) {
|
||||
this->nice = priority;
|
||||
}
|
||||
@ -494,10 +493,7 @@ bool Process_changePriorityBy(Process* this, Arg delta) {
|
||||
}
|
||||
|
||||
bool Process_sendSignal(Process* this, Arg sgn) {
|
||||
CRT_dropPrivileges();
|
||||
bool ok = (kill(this->pid, sgn.i) == 0);
|
||||
CRT_restorePrivileges();
|
||||
return ok;
|
||||
return kill(this->pid, sgn.i) == 0;
|
||||
}
|
||||
|
||||
int Process_pidCompare(const void* v1, const void* v2) {
|
||||
|
Reference in New Issue
Block a user