Commit 872aa4a8 authored by Ingo Molnar's avatar Ingo Molnar

[PATCH] pgrp-fix-2.5.38-A2

This fixes the emacs bug reported by Andries.  It should probably also
fix other, terminal handling related weirdnesses introduced by the new
PID handling code in 2.5.38.

The bug was in the session_of_pgrp() function, if no proper session is
found in the process group then we must take the session ID from the
process that has pgrp PID (which does not necesserily have to be part of
the pgrp).  The fallback code is only triggered when no process in the
process group has a valid session - besides being faster, this also
matches the old implementation.

[ hey, who needs a POSIX conformance testsuite when we have emacs! ;) ]
parent bf72e973
......@@ -131,9 +131,14 @@ int session_of_pgrp(int pgrp)
for_each_task_pid(pgrp, PIDTYPE_PGID, p, l, pid)
if (p->session > 0) {
sid = p->session;
break;
goto out;
}
p = find_task_by_pid(pgrp);
if (p)
sid = p->session;
out:
read_unlock(&tasklist_lock);
return sid;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment