diff options
author | 2008-04-30 00:54:27 -0700 | |
---|---|---|
committer | 2008-04-30 08:29:49 -0700 | |
commit | 83beaf3c6c75b36b7c9be7f555c8cf7797842cc5 (patch) | |
tree | e134ff1fcd8aec134ecde984a4b90d221f79af15 /kernel | |
parent | pids: introduce change_pid() helper (diff) | |
download | linux-83beaf3c6c75b36b7c9be7f555c8cf7797842cc5.tar.gz linux-83beaf3c6c75b36b7c9be7f555c8cf7797842cc5.tar.bz2 linux-83beaf3c6c75b36b7c9be7f555c8cf7797842cc5.zip |
pids: sys_setpgid: use change_pid() helper
Use change_pid() instead of detach_pid() + attach_pid() in sys_setpgid().
This way task_pgrp() 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/sys.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/sys.c b/kernel/sys.c index 47c30a20b554..5d0b44cd435c 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -978,8 +978,7 @@ asmlinkage long sys_setpgid(pid_t pid, pid_t pgid) goto out; if (task_pgrp(p) != pgrp) { - detach_pid(p, PIDTYPE_PGID); - attach_pid(p, PIDTYPE_PGID, pgrp); + change_pid(p, PIDTYPE_PGID, pgrp); set_task_pgrp(p, pid_nr(pgrp)); } |