Merge tag 'microblaze-3.19-rc1' of git://git.monstr.eu/linux-2.6-microblaze
[pandora-kernel.git] / kernel / exit.c
index 8061891..1ea4369 100644 (file)
@@ -211,27 +211,6 @@ repeat:
                goto repeat;
 }
 
-/*
- * This checks not only the pgrp, but falls back on the pid if no
- * satisfactory pgrp is found. I dunno - gdb doesn't work correctly
- * without this...
- *
- * The caller must hold rcu lock or the tasklist lock.
- */
-struct pid *session_of_pgrp(struct pid *pgrp)
-{
-       struct task_struct *p;
-       struct pid *sid = NULL;
-
-       p = pid_task(pgrp, PIDTYPE_PGID);
-       if (p == NULL)
-               p = pid_task(pgrp, PIDTYPE_PID);
-       if (p != NULL)
-               sid = task_session(p);
-
-       return sid;
-}
-
 /*
  * Determine if a process group is "orphaned", according to the POSIX
  * definition in 2.2.2.52.  Orphaned process groups are not to be affected
@@ -632,6 +611,8 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
        }
 
        tsk->exit_state = autoreap ? EXIT_DEAD : EXIT_ZOMBIE;
+       if (tsk->exit_state == EXIT_DEAD)
+               list_add(&tsk->ptrace_entry, &dead);
 
        /* mt-exec, de_thread() is waiting for group leader */
        if (unlikely(tsk->signal->notify_count < 0))
@@ -642,10 +623,6 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
                list_del_init(&p->ptrace_entry);
                release_task(p);
        }
-
-       /* If the process is dead, release it - nobody will wait for it */
-       if (autoreap)
-               release_task(tsk);
 }
 
 #ifdef CONFIG_DEBUG_STACK_USAGE