]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/ptrace.c
mmc: Fix compile for omap_hsmmc.c
[linux-2.6-omap-h63xx.git] / kernel / ptrace.c
index f5a9fa5aafa10eba793c2962db81e6c445c6dffa..aaad0ec341948690d8d8cad7ad22ee0600035fad 100644 (file)
@@ -60,11 +60,15 @@ static void ptrace_untrace(struct task_struct *child)
 {
        spin_lock(&child->sighand->siglock);
        if (task_is_traced(child)) {
-               if (child->signal->flags & SIGNAL_STOP_STOPPED) {
+               /*
+                * If the group stop is completed or in progress,
+                * this thread was already counted as stopped.
+                */
+               if (child->signal->flags & SIGNAL_STOP_STOPPED ||
+                   child->signal->group_stop_count)
                        __set_task_state(child, TASK_STOPPED);
-               } else {
+               else
                        signal_wake_up(child, 1);
-               }
        }
        spin_unlock(&child->sighand->siglock);
 }
@@ -301,11 +305,7 @@ int ptrace_detach(struct task_struct *child, unsigned int data)
         */
        if (child->ptrace) {
                child->exit_code = data;
-
                dead = __ptrace_detach(current, child);
-
-               if (!child->exit_state)
-                       wake_up_process(child);
        }
        write_unlock_irq(&tasklist_lock);
 
@@ -687,8 +687,6 @@ SYSCALL_DEFINE4(ptrace, long, request, long, pid, long, addr, long, data)
                goto out_put_task_struct;
 
        ret = arch_ptrace(child, request, addr, data);
-       if (ret < 0)
-               goto out_put_task_struct;
 
  out_put_task_struct:
        put_task_struct(child);