diff options
author | Benny Baumann <BenBE@geshi.org> | 2021-02-16 19:44:59 +0100 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2021-02-17 15:59:50 +0100 |
commit | 82157f598e09790b408a4e519a25d3affba95240 (patch) | |
tree | 77f86dbd0a50bb2e4017a0fe308e9967adf91279 /Process.c | |
parent | a73064dda97d751047748c4539a969495bdadf73 (diff) |
Refactor to remove no-op calls
This removes the call-sites of the removed setuid feature
Diffstat (limited to 'Process.c')
-rw-r--r-- | Process.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -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) { |