]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/sched.c
[PATCH] Make RLIMIT_NICE ranges consistent with getpriority(2)
[linux-2.6-omap-h63xx.git] / kernel / sched.c
index a646e4f36c4136d49d3ba1444cc22133e21b4d92..5f889d0cbfcc2e614aef87963ec0bea5ea6a5f21 100644 (file)
@@ -3378,8 +3378,8 @@ EXPORT_SYMBOL(set_user_nice);
  */
 int can_nice(const task_t *p, const int nice)
 {
-       /* convert nice value [19,-20] to rlimit style value [0,39] */
-       int nice_rlim = 19 - nice;
+       /* convert nice value [19,-20] to rlimit style value [1,40] */
+       int nice_rlim = 20 - nice;
        return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur ||
                capable(CAP_SYS_NICE));
 }