aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-04-30 03:54:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:49 -0400
commit7d8da0962eaee30b4a380ded177349bfbdd6ac46 (patch)
treecfbdb6d94922264e7e06892275f1e4d5a29017a6 /kernel
parent83beaf3c6c75b36b7c9be7f555c8cf7797842cc5 (diff)
pids: __set_special_pids: use change_pid() helper
Use change_pid() instead of detach_pid() + attach_pid() in __set_special_pids(). This way task_session() is not NULL in between. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Pavel Emelyanov <xemul@openvz.org> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/exit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 0da2921b1e7f..d3ad54677f9c 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -334,13 +334,11 @@ void __set_special_pids(struct pid *pid)
334 pid_t nr = pid_nr(pid); 334 pid_t nr = pid_nr(pid);
335 335
336 if (task_session(curr) != pid) { 336 if (task_session(curr) != pid) {
337 detach_pid(curr, PIDTYPE_SID); 337 change_pid(curr, PIDTYPE_SID, pid);
338 attach_pid(curr, PIDTYPE_SID, pid);
339 set_task_session(curr, nr); 338 set_task_session(curr, nr);
340 } 339 }
341 if (task_pgrp(curr) != pid) { 340 if (task_pgrp(curr) != pid) {
342 detach_pid(curr, PIDTYPE_PGID); 341 change_pid(curr, PIDTYPE_PGID, pid);
343 attach_pid(curr, PIDTYPE_PGID, pid);
344 set_task_pgrp(curr, nr); 342 set_task_pgrp(curr, nr);
345 } 343 }
346} 344}