aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/exit.c')
-rw-r--r--kernel/exit.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/kernel/exit.c b/kernel/exit.c
index 14f17033f563..3ac6a7a6f857 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -185,21 +185,19 @@ repeat:
185 * This checks not only the pgrp, but falls back on the pid if no 185 * This checks not only the pgrp, but falls back on the pid if no
186 * satisfactory pgrp is found. I dunno - gdb doesn't work correctly 186 * satisfactory pgrp is found. I dunno - gdb doesn't work correctly
187 * without this... 187 * without this...
188 *
189 * The caller must hold rcu lock or the tasklist lock.
188 */ 190 */
189int session_of_pgrp(int pgrp) 191struct pid *session_of_pgrp(struct pid *pgrp)
190{ 192{
191 struct task_struct *p; 193 struct task_struct *p;
192 int sid = 0; 194 struct pid *sid = NULL;
193
194 read_lock(&tasklist_lock);
195 195
196 p = find_task_by_pid_type(PIDTYPE_PGID, pgrp); 196 p = pid_task(pgrp, PIDTYPE_PGID);
197 if (p == NULL) 197 if (p == NULL)
198 p = find_task_by_pid(pgrp); 198 p = pid_task(pgrp, PIDTYPE_PID);
199 if (p != NULL) 199 if (p != NULL)
200 sid = process_session(p); 200 sid = task_session(p);
201
202 read_unlock(&tasklist_lock);
203 201
204 return sid; 202 return sid;
205} 203}