|
@@ -2002,7 +2002,8 @@ static inline int pid_alive(const struct task_struct *p)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * is_global_init - check if a task structure is init
|
|
|
+ * is_global_init - check if a task structure is init. Since init
|
|
|
+ * is free to have sub-threads we need to check tgid.
|
|
|
* @tsk: Task structure to be checked.
|
|
|
*
|
|
|
* Check if a task structure is the first user space task the kernel created.
|
|
@@ -2011,7 +2012,7 @@ static inline int pid_alive(const struct task_struct *p)
|
|
|
*/
|
|
|
static inline int is_global_init(struct task_struct *tsk)
|
|
|
{
|
|
|
- return tsk->pid == 1;
|
|
|
+ return task_tgid_nr(tsk) == 1;
|
|
|
}
|
|
|
|
|
|
extern struct pid *cad_pid;
|