--- exit.c.0 Wed Feb 9 10:55:11 2000 +++ exit.c Wed Feb 9 10:52:05 2000 @@ -470,43 +470,38 @@ if ((p->exit_signal != SIGCHLD) ^ ((options & __WCLONE) != 0)) continue; flag = 1; - switch (p->state) { - case TASK_STOPPED: - if (!p->exit_code) - continue; - if (!(options & WUNTRACED) && !(p->flags & PF_PTRACED)) - continue; - read_unlock(&tasklist_lock); - retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; - if (!retval && stat_addr) - retval = put_user((p->exit_code << 8) | 0x7f, stat_addr); - if (!retval) { - p->exit_code = 0; - retval = p->pid; - } - goto end_wait4; - case TASK_ZOMBIE: - current->times.tms_cutime += p->times.tms_utime + p->times.tms_cutime; - current->times.tms_cstime += p->times.tms_stime + p->times.tms_cstime; - read_unlock(&tasklist_lock); - retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; - if (!retval && stat_addr) - retval = put_user(p->exit_code, stat_addr); - if (retval) - goto end_wait4; - retval = p->pid; - if (p->p_opptr != p->p_pptr) { - write_lock_irq(&tasklist_lock); - REMOVE_LINKS(p); - p->p_pptr = p->p_opptr; - SET_LINKS(p); - write_unlock_irq(&tasklist_lock); - notify_parent(p, SIGCHLD); - } else - release(p); - goto end_wait4; - default: + if (p->state == TASK_STOPPED && p->exit_code) { + if (!(options & WUNTRACED) && !(p->flags & PF_PTRACED)) continue; + read_unlock(&tasklist_lock); + retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; + if (!retval && stat_addr) + retval = put_user((p->exit_code << 8) | 0x7f, stat_addr); + if (!retval) { + p->exit_code = 0; + retval = p->pid; + } + goto end_wait4; + } else if (p->state == TASK_ZOMBIE) { + current->times.tms_cutime += p->times.tms_utime + p->times.tms_cutime; + current->times.tms_cstime += p->times.tms_stime + p->times.tms_cstime; + read_unlock(&tasklist_lock); + retval = ru ? getrusage(p, RUSAGE_BOTH, ru) : 0; + if (!retval && stat_addr) + retval = put_user(p->exit_code, stat_addr); + if (retval) + goto end_wait4; + retval = p->pid; + if (p->p_opptr != p->p_pptr) { + write_lock_irq(&tasklist_lock); + REMOVE_LINKS(p); + p->p_pptr = p->p_opptr; + SET_LINKS(p); + write_unlock_irq(&tasklist_lock); + notify_parent(p, SIGCHLD); + } else + release(p); + goto end_wait4; } } read_unlock(&tasklist_lock);