Re: [PATCH 7/8] taskstats: fix stats->ac_exitcode to work onthreads and use group_exit_code

From: Guillaume Chazarain
Date: Wed Sep 26 2007 - 16:58:00 EST


Le Wed, 26 Sep 2007 22:47:54 +0200,
roel <12o3l@xxxxxxxxxx> a Ãcrit :

> > + if (thread_group_leader(tsk) && ((tsk->flags & PF_FORKNOEXEC)))
>
> if (thread_group_leader(tsk) && (tsk->flags & PF_FORKNOEXEC))

Yeah, right, good catch.

> > + group_exit_code = tg_stats ? tsk->signal->group_exit_code : 0;
> > + stats->ac_exitcode = group_exit_code ? : tsk->exit_code;
>
> Isn't this just confusing? why not
>
> if (tg_stats) {
> group_exit_code = tsk->signal->group_exit_code;
> stats->ac_exitcode = group_exit_code;

Because in this case if group_exit_code is null, we want
tsk->exit_code, not 0.

>
> } else {
> group_exit_code = 0;
> stats->ac_exitcode = tsk->exit_code;
> }

Andrew is not interested at the moment in this series (that replaces
all my previous patches on taskstats, for info), but thank you for the
review.


--
Guillaume
-
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/