Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142905
b: refs/heads/master
c: 6279a75
h: refs/heads/master
i:
  142903: 1d17dc8
v: v3
  • Loading branch information
Oleg Nesterov authored and Ingo Molnar committed Apr 8, 2009
1 parent aa82d57 commit 8f1655e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 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: 633fe795b80693a8198e7d82f66538a72d2bbba2
refs/heads/master: 6279a751fe096a21dc7704e918d570d3ff06e769
13 changes: 9 additions & 4 deletions trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,12 @@ static void posix_cpu_timers_init_group(struct signal_struct *sig)
sig->cputime_expires.virt_exp = cputime_zero;
sig->cputime_expires.sched_exp = 0;

if (sig->rlim[RLIMIT_CPU].rlim_cur != RLIM_INFINITY) {
sig->cputime_expires.prof_exp =
secs_to_cputime(sig->rlim[RLIMIT_CPU].rlim_cur);
sig->cputimer.running = 1;
}

/* The timer lists. */
INIT_LIST_HEAD(&sig->cpu_timers[0]);
INIT_LIST_HEAD(&sig->cpu_timers[1]);
Expand All @@ -823,11 +829,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
atomic_inc(&current->signal->live);
return 0;
}
sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);

if (sig)
posix_cpu_timers_init_group(sig);

sig = kmem_cache_alloc(signal_cachep, GFP_KERNEL);
tsk->signal = sig;
if (!sig)
return -ENOMEM;
Expand Down Expand Up @@ -865,6 +868,8 @@ static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)
memcpy(sig->rlim, current->signal->rlim, sizeof sig->rlim);
task_unlock(current->group_leader);

posix_cpu_timers_init_group(sig);

acct_init_pacct(&sig->pacct);

tty_audit_fork(sig);
Expand Down

0 comments on commit 8f1655e

Please sign in to comment.