From 297bd42b15daed02453ff59ce6d31216a58b0398 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Fri, 8 Feb 2008 04:19:10 -0800 Subject: move daemonized kernel threads into the swapper's session Daemonized kernel threads run in the init's session. This doesn't match the behaviour of kthread_create()'ed threads, and this is one of the 2 reasons why we need a special hack in sys_setsid(). Now that set_special_pids() was changed to use struct pid, not pid_t, we can use init_struct_pid and set 0,0 special pids. Signed-off-by: Oleg Nesterov Acked-by: "Eric W. Biederman" Cc: Pavel Emelyanov Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/exit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kernel') diff --git a/kernel/exit.c b/kernel/exit.c index 96716fd22373..d7815f570882 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -388,7 +388,7 @@ void daemonize(const char *name, ...) get_nsproxy(&init_nsproxy); switch_task_namespaces(current, &init_nsproxy); } - set_special_pids(find_pid(1)); + set_special_pids(&init_struct_pid); proc_clear_tty(current); /* Block and flush all signals */ -- cgit v1.2.2