mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: wli@holomorphy.com
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu
Subject: [pidhash] [1/4] Make __do_SAK() use for_each_task_pid().
Date: Wed, 04 Dec 2002 23:48:27 -0800	[thread overview]
Message-ID: <0212042348.MagbHaKdKcEaTd3dPb5dTdIcCb8dWbca15950@holomorphy.com> (raw)
In-Reply-To: <0212042348.vaibscRdmcpcAbdcfb9d~c3c4bNczcIa15950@holomorphy.com>

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(-)


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);

  reply	other threads:[~2002-12-05  7:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-05  7:48 [pidhash] [0/4] patch series vs. 2.5.50-mm1 wli
2002-12-05  7:48 ` wli [this message]
2002-12-05  7:48   ` [pidhash] [2/4] make cap_set_pg() use for_each_task_pid() wli
2002-12-05  7:48     ` [pidhash] [3/4] eliminate proc_fill_super() tasklist iteration wli
2002-12-05  7:48       ` [pidhash] [5/4] make get_pid_list() scan the PID bitmap wli
2002-12-05  8:50 ` [pidhash] [0/4] patch series vs. 2.5.50-mm1 William Lee Irwin III

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0212042348.MagbHaKdKcEaTd3dPb5dTdIcCb8dWbca15950@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®