From 82157f598e09790b408a4e519a25d3affba95240 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Tue, 16 Feb 2021 19:44:59 +0100 Subject: Refactor to remove no-op calls This removes the call-sites of the removed setuid feature --- Process.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'Process.c') diff --git a/Process.c b/Process.c index 9ee7a0f8..3fbcb634 100644 --- a/Process.c +++ b/Process.c @@ -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) { -- cgit v1.2.3