pids: sys_setpgid: use change_pid() helper
PATCH 3/4 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 <[email protected]>
kernel/sys.c renamed from kernel/sys.c~3_SETPGRP +1 -2
@@ -972,8 +972,7 @@ asmlinkage long sys_setpgid(pid_t pid, p 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)); }