[PATCH] Make RLIMIT_NICE ranges consistent with getpriority(2)

As suggested by Michael Kerrisk <mtk-manpages@gmx.net>, make RLIMIT_NICE
consistent with getpriority before it becomes available in released glibc.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Matt Mackall and committed by Linus Torvalds 024f4747 6cbe9de7

+2 -2
+2 -2
kernel/sched.c
··· 3378 3378 */ 3379 3379 int can_nice(const task_t *p, const int nice) 3380 3380 { 3381 - /* convert nice value [19,-20] to rlimit style value [0,39] */ 3382 - int nice_rlim = 19 - nice; 3381 + /* convert nice value [19,-20] to rlimit style value [1,40] */ 3382 + int nice_rlim = 20 - nice; 3383 3383 return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur || 3384 3384 capable(CAP_SYS_NICE)); 3385 3385 }