From 2dc5a9bc5e4caa38ef8e537a385c547dd5847fdc Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Tue, 4 Dec 2007 23:45:04 -0800 Subject: [PATCH] --- yaml --- r: 74582 b: refs/heads/master c: 5cd17569fd0eeca510735e63a6061291e3971bf6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/fork.c | 21 ++++++--------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index be91a92946b0..d353c6b52f77 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e00ba3dae077f54cfd2af42e939a618caa7a3bca +refs/heads/master: 5cd17569fd0eeca510735e63a6061291e3971bf6 diff --git a/trunk/kernel/fork.c b/trunk/kernel/fork.c index 8ca1a14cdc8c..8dd8ff281009 100644 --- a/trunk/kernel/fork.c +++ b/trunk/kernel/fork.c @@ -1292,23 +1292,14 @@ static struct task_struct *copy_process(unsigned long clone_flags, __ptrace_link(p, current->parent); if (thread_group_leader(p)) { - if (clone_flags & CLONE_NEWPID) { + if (clone_flags & CLONE_NEWPID) p->nsproxy->pid_ns->child_reaper = p; - p->signal->tty = NULL; - set_task_pgrp(p, p->pid); - set_task_session(p, p->pid); - attach_pid(p, PIDTYPE_PGID, pid); - attach_pid(p, PIDTYPE_SID, pid); - } else { - p->signal->tty = current->signal->tty; - set_task_pgrp(p, task_pgrp_nr(current)); - set_task_session(p, task_session_nr(current)); - attach_pid(p, PIDTYPE_PGID, - task_pgrp(current)); - attach_pid(p, PIDTYPE_SID, - task_session(current)); - } + p->signal->tty = current->signal->tty; + set_task_pgrp(p, task_pgrp_nr(current)); + set_task_session(p, task_session_nr(current)); + attach_pid(p, PIDTYPE_PGID, task_pgrp(current)); + attach_pid(p, PIDTYPE_SID, task_session(current)); list_add_tail_rcu(&p->tasks, &init_task.tasks); __get_cpu_var(process_counts)++; }