]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - kernel/exit.c
Add buffer head related helper functions
[linux-2.6-omap-h63xx.git] / kernel / exit.c
index f1aec27f1df00eaae4cbb9c3f99dde1b4e1c8520..549c0558ba68273c7586b26f6579d12c27d0f79d 100644 (file)
@@ -1357,7 +1357,7 @@ static int wait_task_stopped(struct task_struct *p, int delayed_group_leader,
                             int __user *stat_addr, struct rusage __user *ru)
 {
        int retval, exit_code;
-       struct pid_namespace *ns;
+       pid_t pid;
 
        if (!p->exit_code)
                return 0;
@@ -1376,21 +1376,19 @@ static int wait_task_stopped(struct task_struct *p, int delayed_group_leader,
         * keep holding onto the tasklist_lock while we call getrusage and
         * possibly take page faults for user memory.
         */
-       ns = current->nsproxy->pid_ns;
+       pid = task_pid_nr_ns(p, current->nsproxy->pid_ns);
        get_task_struct(p);
        read_unlock(&tasklist_lock);
 
        if (unlikely(noreap)) {
-               pid_t pid = task_pid_nr_ns(p, ns);
                uid_t uid = p->uid;
                int why = (p->ptrace & PT_PTRACED) ? CLD_TRAPPED : CLD_STOPPED;
 
                exit_code = p->exit_code;
-               if (unlikely(!exit_code) ||
-                   unlikely(p->state & TASK_TRACED))
+               if (unlikely(!exit_code) || unlikely(p->exit_state))
                        goto bail_ref;
                return wait_noreap_copyout(p, pid, uid,
-                                          why, (exit_code << 8) | 0x7f,
+                                          why, exit_code,
                                           infop, ru);
        }
 
@@ -1452,11 +1450,11 @@ bail_ref:
        if (!retval && infop)
                retval = put_user(exit_code, &infop->si_status);
        if (!retval && infop)
-               retval = put_user(task_pid_nr_ns(p, ns), &infop->si_pid);
+               retval = put_user(pid, &infop->si_pid);
        if (!retval && infop)
                retval = put_user(p->uid, &infop->si_uid);
        if (!retval)
-               retval = task_pid_nr_ns(p, ns);
+               retval = pid;
        put_task_struct(p);
 
        BUG_ON(!retval);