aboutsummaryrefslogtreecommitdiffstats
path: root/Process.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:16 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:16 +0200
commitc868e3f8d629e1caddff1a51a7d2dd04f49994a3 (patch)
treedee0881088acc628312dcaaff8209184f4a2560b /Process.c
parentd3c9975943df58e293359b87905d19ff1fd52061 (diff)
downloaddebian_htop-c868e3f8d629e1caddff1a51a7d2dd04f49994a3.tar.gz
debian_htop-c868e3f8d629e1caddff1a51a7d2dd04f49994a3.tar.bz2
debian_htop-c868e3f8d629e1caddff1a51a7d2dd04f49994a3.zip
Imported Upstream version 0.5.1upstream/0.5.1
Diffstat (limited to 'Process.c')
-rw-r--r--Process.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Process.c b/Process.c
index 4483325..81fea4e 100644
--- a/Process.c
+++ b/Process.c
@@ -170,8 +170,9 @@ bool Process_equals(const Object* o1, const Object* o2) {
}
void Process_setPriority(Process* this, int priority) {
+ int old_prio = getpriority(PRIO_PROCESS, this->pid);
int err = setpriority(PRIO_PROCESS, this->pid, priority);
- if (err == 0) {
+ if (err == 0 && old_prio != getpriority(PRIO_PROCESS, this->pid)) {
this->nice = priority;
}
}

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