summaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2021-02-16 19:44:59 +0100
committerBenny Baumann <BenBE@geshi.org>2021-02-17 15:59:50 +0100
commit82157f598e09790b408a4e519a25d3affba95240 (patch)
tree77f86dbd0a50bb2e4017a0fe308e9967adf91279 /Process.c
parenta73064dda97d751047748c4539a969495bdadf73 (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.c8
1 files changed, 2 insertions, 6 deletions
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) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy