lkml.org 
[lkml]   [2002]   [Dec]   [5]   [last100]   RSS-feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Complete thread (EXPERIMENTAL)
Patch in this message
/
DateWed, 04 Dec 2002 23:48:27 -0800
From wli@holomorp ...
Subject[pidhash] [1/4] Make __do_SAK() use for_each_task_pid().
Digg This
Kill off the for_each_process() in __do_SAK(): it really just wants to do a hangup using SIGKILL.

 tty_io.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)


[view this diff only]
diff -urpN mm1-2.5.50-1/drivers/char/tty_io.c mm1-2.5.50-2/drivers/char/tty_io.c
--- mm1-2.5.50-1/drivers/char/tty_io.c	2002-12-04 12:49:46.000000000 -0800
+++ mm1-2.5.50-2/drivers/char/tty_io.c	2002-12-04 13:06:20.000000000 -0800
@@ -1838,6 +1838,8 @@ static void __do_SAK(void *arg)
 #else
 	struct tty_struct *tty = arg;
 	struct task_struct *p;
+	struct list_head *l;
+	struct pid *pid;
 	int session;
 	int		i;
 	struct file	*filp;
@@ -1850,9 +1852,8 @@ static void __do_SAK(void *arg)
 	if (tty->driver.flush_buffer)
 		tty->driver.flush_buffer(tty);
 	read_lock(&tasklist_lock);
-	for_each_process(p) {
-		if ((p->tty == tty) ||
-		    ((session > 0) && (p->session == session))) {
+	for_each_task_pid(session, PIDTYPE_SID, p, l, pid) {
+		if (p->tty == tty || session > 0) {
 			printk(KERN_NOTICE "SAK: killed process %d"
 			    " (%s): p->session==tty->session\n",
 			    p->pid, p->comm);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
ISP Services
Valid XHTML 1.0!\ /
Valid CSS! Last update: 2005-03-22 12:31    [W:0.054 / U:0.640 seconds]
©2003-2005 Jasper Spaans