Re: [PATCH 1/3] do_wait reorganization

From: Roland McGrath
Date: Mon Mar 31 2008 - 16:30:30 EST


> This looks wrong, we shouldn't clear *retval if the child is EXIT_DEAD.

You're right. Thanks for catching that.
I think it should look like this:

{
int ret = eligible_child(type, pid, options, p);
if (ret <= 0)
return ret;

if (p->exit_state == EXIT_DEAD)
return 0;

/*
* We don't reap group leaders with subthreads.
*/
if (p->exit_state == EXIT_ZOMBIE && !delay_group_leader(p))
return wait_task_zombie(p, options, infop, stat_addr, ru);

/*
* It's stopped or running now, so it might
* later continue, exit, or stop again.
*/
*retval = 0;

if (task_is_stopped_or_traced(p))
return wait_task_stopped(p, options, infop, stat_addr, ru);

return wait_task_continued(p, options, infop, stat_addr, ru);
}

What do you think?


Thanks,
Roland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/