diff options
author | Daniel Walker <dwalker@mvista.com> | 2007-05-10 22:22:53 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-11 08:29:35 -0700 |
commit | 3e88c553db938ad016026375f0545304b9030b42 (patch) | |
tree | bbf9f04dea6f70e6a93a7b26e13db4778c9f3221 /kernel/sys.c | |
parent | 00b8fd236764e3d5bc1d30dc65e256e283de4c3d (diff) | |
download | linux-stable-3e88c553db938ad016026375f0545304b9030b42.tar.gz linux-stable-3e88c553db938ad016026375f0545304b9030b42.tar.bz2 linux-stable-3e88c553db938ad016026375f0545304b9030b42.zip |
use defines in sys_getpriority/sys_setpriority
Switch to the defines for these two checks, instead of hard coding the
values.
[akpm@linux-foundation.org: add missing include]
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sys.c')
-rw-r--r-- | kernel/sys.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index ec319bbb0bd4..df4c3a8f5df9 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -14,6 +14,7 @@ #include <linux/prctl.h> #include <linux/highuid.h> #include <linux/fs.h> +#include <linux/resource.h> #include <linux/kernel.h> #include <linux/kexec.h> #include <linux/workqueue.h> @@ -659,7 +660,7 @@ asmlinkage long sys_setpriority(int which, int who, int niceval) int error = -EINVAL; struct pid *pgrp; - if (which > 2 || which < 0) + if (which > PRIO_USER || which < PRIO_PROCESS) goto out; /* normalize: avoid signed division (rounding problems) */ @@ -723,7 +724,7 @@ asmlinkage long sys_getpriority(int which, int who) long niceval, retval = -ESRCH; struct pid *pgrp; - if (which > 2 || which < 0) + if (which > PRIO_USER || which < PRIO_PROCESS) return -EINVAL; read_lock(&tasklist_lock); |