Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54698
b: refs/heads/master
c: 9926e4c
h: refs/heads/master
v: v3
  • Loading branch information
Tom Alsberg authored and Linus Torvalds committed May 8, 2007
1 parent d35ff92 commit 2ebc82b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a4bb27d99ca2986e30180a0eb143865051b909db
refs/heads/master: 9926e4c74300c4b31dee007298c6475d33369df0
19 changes: 10 additions & 9 deletions trunk/kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,16 @@ asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim)
if (retval)
return retval;

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;
}

task_lock(current->group_leader);
*old_rlim = new_rlim;
task_unlock(current->group_leader);
Expand All @@ -1944,15 +1954,6 @@ asmlinkage long sys_setrlimit(unsigned int resource, struct rlimit __user *rlim)
unsigned long rlim_cur = new_rlim.rlim_cur;
cputime_t cputime;

if (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
*/
rlim_cur = 1;
}
cputime = secs_to_cputime(rlim_cur);
read_lock(&tasklist_lock);
spin_lock_irq(&current->sighand->siglock);
Expand Down

0 comments on commit 2ebc82b

Please sign in to comment.