* and to assume its PID:
*/
if (!thread_group_leader(current)) {
- struct task_struct *parent;
struct dentry *proc_dentry1, *proc_dentry2;
- unsigned long ptrace;
/*
* Wait for the thread group leader to be a zombie.
* two threads with a switched PID, and release
* the former thread group leader:
*/
- ptrace = leader->ptrace;
- parent = leader->parent;
- if (unlikely(ptrace) && unlikely(parent == current)) {
- /*
- * Joker was ptracing his own group leader,
- * and now he wants to be his own parent!
- * We can't have that.
- */
- ptrace = 0;
- }
-
- ptrace_unlink(current);
- ptrace_unlink(leader);
- remove_parent(current);
- remove_parent(leader);
-
/* Become a process group leader with the old leader's pid.
* Note: The old leader also uses thispid until release_task
attach_pid(current, PIDTYPE_SID, current->signal->session);
list_add_tail(¤t->tasks, &init_task.tasks);
- current->parent = current->real_parent = leader->real_parent;
- leader->parent = leader->real_parent = child_reaper;
current->group_leader = current;
leader->group_leader = current;
detach_pid(leader, PIDTYPE_SID);
list_del_init(&leader->tasks);
- add_parent(current);
- add_parent(leader);
- if (ptrace) {
- current->ptrace = ptrace;
- __ptrace_link(current, parent);
- }
-
current->exit_signal = SIGCHLD;
BUG_ON(leader->exit_state != EXIT_ZOMBIE);