Subject: [PATCH] Update the task_alive logic to count the idle thread as alive. From: Eric W. Biederman Date: 1130614408 -0600 --- include/linux/sched.h | 4 ++-- kernel/pid.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) a0c0c52d0dc733a2452dafcab054e041ea6a9b0c diff --git a/include/linux/sched.h b/include/linux/sched.h index 9388018..5615c5a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -60,7 +60,7 @@ struct exec_domain; #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ -#define CLONE_NEWPSPACE 0x04000000 /* New process space groupe? */ +#define CLONE_NEWPSPACE 0x04000000 /* New process space group? */ /* * List of flags we want to share for kernel threads, @@ -832,7 +832,7 @@ static inline pid_t process_group(struct */ static inline int task_alive(struct task_struct *p) { - return p->pids[PIDTYPE_TID].nr != 0; + return p->pids[PIDTYPE_TID].nr != -1; } extern void free_task(struct task_struct *tsk); diff --git a/kernel/pid.c b/kernel/pid.c index 604c005..6144189 100644 --- a/kernel/pid.c +++ b/kernel/pid.c @@ -192,7 +192,7 @@ static fastcall int __detach_pid(task_t } list_del(&pid->pid_list); - pid->nr = 0; + pid->nr = -1; return nr; } -- 1.0.GIT