Refactor to remove no-op calls

This removes the call-sites of the removed setuid feature
This commit is contained in:
Benny Baumann
2021-02-16 19:44:59 +01:00
parent a73064dda9
commit 82157f598e
5 changed files with 6 additions and 27 deletions

View File

@ -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) {