Subject: [PATCH] proc: tweak the definition of task_alive From: Eric W. Biederman Date: 1134673394 -0700 Attempt to find a definition of task_alive that works even for pid 0. Would testing the task state be better? --- include/linux/sched.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) cce49eb855411c315c11952d3ede8325a480f605 diff --git a/include/linux/sched.h b/include/linux/sched.h index e9c3124..3a18d73 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -835,12 +835,12 @@ static inline pid_t process_group(struct * @p: Task structure to be checked. * * Test if a process is not yet dead (at most zombie state) - * If pid_alive fails, then pointers within the task structure + * If task_alive fails, then pointers within the task structure * can be stale and must not be dereferenced. */ static inline int task_alive(struct task_struct *p) { - return p->pids[PIDTYPE_TID].nr != -1; + return p->pids[PIDTYPE_TID].pid_list.next != LIST_POISON1; } extern void free_task(struct task_struct *tsk); -- 1.0.GIT