summaryrefslogtreecommitdiff
path: root/kernel/fork.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fork.c')
-rw-r--r--kernel/fork.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/fork.c b/kernel/fork.c
index 9353b2e96700..78db8811c834 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1124,14 +1124,13 @@ static task_t *copy_process(unsigned long clone_flags,
__ptrace_link(p, current->parent);
attach_pid(p, PIDTYPE_PID, p->pid);
+ attach_pid(p, PIDTYPE_TGID, p->tgid);
if (thread_group_leader(p)) {
- attach_pid(p, PIDTYPE_TGID, p->tgid);
attach_pid(p, PIDTYPE_PGID, process_group(p));
attach_pid(p, PIDTYPE_SID, p->signal->session);
if (p->pid)
__get_cpu_var(process_counts)++;
- } else
- link_pid(p, p->pids + PIDTYPE_TGID, &p->group_leader->pids[PIDTYPE_TGID].pid);
+ }
nr_threads++;
write_unlock_irq(&tasklist_lock);