public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] pgrp-fix-2.5.38-A2
@ 2002-09-24  9:06 Ingo Molnar
  2002-09-24  9:51 ` William Lee Irwin III
  0 siblings, 1 reply; 2+ messages in thread
From: Ingo Molnar @ 2002-09-24  9:06 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linux-kernel, Andries Brouwer, William Lee Irwin III


the attached patch, against BK-curr, 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! ;) ]

	Ingo

--- linux/kernel/exit.c.orig	Tue Sep 24 10:29:09 2002
+++ linux/kernel/exit.c	Tue Sep 24 10:58:40 2002
@@ -131,9 +131,14 @@
 	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;
 }
 


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [patch] pgrp-fix-2.5.38-A2
  2002-09-24  9:06 [patch] pgrp-fix-2.5.38-A2 Ingo Molnar
@ 2002-09-24  9:51 ` William Lee Irwin III
  0 siblings, 0 replies; 2+ messages in thread
From: William Lee Irwin III @ 2002-09-24  9:51 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Linus Torvalds, linux-kernel, Andries Brouwer

On Tue, Sep 24, 2002 at 11:06:51AM +0200, Ingo Molnar wrote:
> the attached patch, against BK-curr, fixes the emacs bug reported by
> Andries. It should probably also fix other, terminal handling related
> 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! ;) ]
> 	Ingo

Fix verified here. aeb's testcase now succeeds.


Cheers,
Bill

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-09-24  9:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-24  9:06 [patch] pgrp-fix-2.5.38-A2 Ingo Molnar
2002-09-24  9:51 ` William Lee Irwin III

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox