diff options
author | Oleg Nesterov <oleg@tv-sign.ru> | 2006-12-08 02:38:03 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 08:28:52 -0800 |
commit | 62dfb5541a025b47df9405ff0219c7829a97d83b (patch) | |
tree | 4690d5d0bb750f977a0b73662019e5ced3ab99b4 /kernel | |
parent | f020bc468fe4a91d32046d448511978c7b611315 (diff) | |
download | kernel-common-62dfb5541a025b47df9405ff0219c7829a97d83b.tar.gz kernel-common-62dfb5541a025b47df9405ff0219c7829a97d83b.tar.bz2 kernel-common-62dfb5541a025b47df9405ff0219c7829a97d83b.zip |
[PATCH] session_of_pgrp: kill unnecessary do_each_task_pid(PIDTYPE_PGID)
All members of the process group have the same sid and it can't be == 0.
NOTE: this code (and a similar one in sys_setpgid) was needed because it
was possibe to have ->session == 0. It's not possible any longer since
[PATCH] pidhash: don't use zero pids
Commit: c7c6464117a02b0d54feb4ebeca4db70fa493678
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index fd0e067952ab..03e64fe4a14a 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -189,21 +189,18 @@ repeat: int session_of_pgrp(int pgrp) { struct task_struct *p; - int sid = -1; + int sid = 0; read_lock(&tasklist_lock); - do_each_task_pid(pgrp, PIDTYPE_PGID, p) { - if (process_session(p) > 0) { - sid = process_session(p); - goto out; - } - } while_each_task_pid(pgrp, PIDTYPE_PGID, p); - p = find_task_by_pid(pgrp); - if (p) + + p = find_task_by_pid_type(PIDTYPE_PGID, pgrp); + if (p == NULL) + p = find_task_by_pid(pgrp); + if (p != NULL) sid = process_session(p); -out: + read_unlock(&tasklist_lock); - + return sid; } |