sh_eth: remove redundant test on unsigned
[pandora-kernel.git] / kernel / exit.c
index dd83c84..628d41f 100644 (file)
@@ -1082,8 +1082,8 @@ SYSCALL_DEFINE1(exit_group, int, error_code)
 
 struct wait_opts {
        enum pid_type           wo_type;
-       struct pid              *wo_pid;
        int                     wo_flags;
+       struct pid              *wo_pid;
 
        struct siginfo __user   *wo_info;
        int __user              *wo_stat;
@@ -1197,8 +1197,11 @@ static int wait_task_zombie(struct wait_opts *wo, struct task_struct *p)
        }
 
        traced = ptrace_reparented(p);
-
-       if (likely(!traced)) {
+       /*
+        * It can be ptraced but not reparented, check
+        * !task_detached() to filter out sub-threads.
+        */
+       if (likely(!traced) && likely(!task_detached(p))) {
                struct signal_struct *psig;
                struct signal_struct *sig;
 
@@ -1581,7 +1584,7 @@ repeat:
           (!wo->wo_pid || hlist_empty(&wo->wo_pid->tasks[wo->wo_type])))
                goto notask;
 
-       current->state = TASK_INTERRUPTIBLE;
+       set_current_state(TASK_INTERRUPTIBLE);
        read_lock(&tasklist_lock);
        tsk = current;
        do {
@@ -1608,7 +1611,7 @@ notask:
                }
        }
 end:
-       current->state = TASK_RUNNING;
+       __set_current_state(TASK_RUNNING);
        remove_wait_queue(&current->signal->wait_chldexit,&wait);
        if (wo->wo_info) {
                struct siginfo __user *infop = wo->wo_info;