Merge branch 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / kernel / sys.c
index d605fe5..a611d1d 100644 (file)
@@ -1557,15 +1557,6 @@ int do_prlimit(struct task_struct *tsk, unsigned int resource,
                        retval = -EPERM;
                if (!retval)
                        retval = security_task_setrlimit(tsk, resource, new_rlim);
-               if (resource == RLIMIT_CPU && new_rlim->rlim_cur == 0) {
-                       /*
-                        * The caller is asking for an immediate RLIMIT_CPU
-                        * expiry.  But we use the zero value to mean "it was
-                        * never set".  So let's cheat and make it one second
-                        * instead
-                        */
-                       new_rlim->rlim_cur = 1;
-               }
        }
        if (!retval) {
                if (old_rlim)
@@ -1576,10 +1567,9 @@ int do_prlimit(struct task_struct *tsk, unsigned int resource,
        task_unlock(tsk->group_leader);
 
        /*
-        * RLIMIT_CPU handling.   Note that the kernel fails to return an error
-        * code if it rejected the user's attempt to set RLIMIT_CPU.  This is a
-        * very long-standing error, and fixing it now risks breakage of
-        * applications, so we live with it
+        * RLIMIT_CPU handling. Arm the posix CPU timer if the limit is not
+        * infite. In case of RLIM_INFINITY the posix CPU timer code
+        * ignores the rlimit.
         */
         if (!retval && new_rlim && resource == RLIMIT_CPU &&
             new_rlim->rlim_cur != RLIM_INFINITY &&