summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorCedric Le Goater <clg@fr.ibm.com>2006-12-08 02:37:54 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-08 08:28:51 -0800
commit937949d9edbf4049bd41af6c9f92c26280584564 (patch)
treed0a28f503b082f890cfa1f7fe952fda8fc771752 /drivers
parentef55d53caa055aedee13e77da82740987dd64f2d (diff)
downloadkernel-common-937949d9edbf4049bd41af6c9f92c26280584564.tar.gz
kernel-common-937949d9edbf4049bd41af6c9f92c26280584564.tar.bz2
kernel-common-937949d9edbf4049bd41af6c9f92c26280584564.zip
[PATCH] add process_session() helper routine
Replace occurences of task->signal->session by a new process_session() helper routine. It will be useful for pid namespaces to abstract the session pid number. Signed-off-by: Cedric Le Goater <clg@fr.ibm.com> Cc: Kirill Korotaev <dev@openvz.org> Cc: Eric W. Biederman <ebiederm@xmission.com> Cc: Herbert Poetzl <herbert@13thfloor.at> Cc: Sukadev Bhattiprolu <sukadev@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/mxser.c2
-rw-r--r--drivers/char/rocket.c2
-rw-r--r--drivers/char/tty_io.c12
3 files changed, 8 insertions, 8 deletions
diff --git a/drivers/char/mxser.c b/drivers/char/mxser.c
index 5ed2486b7581..b1cc89c89820 100644
--- a/drivers/char/mxser.c
+++ b/drivers/char/mxser.c
@@ -994,7 +994,7 @@ static int mxser_open(struct tty_struct *tty, struct file *filp)
mxser_change_speed(info, NULL);
}
- info->session = current->signal->session;
+ info->session = process_session(current);
info->pgrp = process_group(current);
/*
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index bac80056f7e0..4fdf52e9f3b1 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -1017,7 +1017,7 @@ static int rp_open(struct tty_struct *tty, struct file *filp)
/*
* Info->count is now 1; so it's safe to sleep now.
*/
- info->session = current->signal->session;
+ info->session = process_session(current);
info->pgrp = process_group(current);
if ((info->flags & ROCKET_INITIALIZED) == 0) {
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 8a2d26e98ac4..4ebba7ca1dc9 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -1511,7 +1511,7 @@ void disassociate_ctty(int on_exit)
spin_lock_irq(&current->sighand->siglock);
current->signal->tty_old_pgrp = 0;
- session = current->signal->session;
+ session = process_session(current);
spin_unlock_irq(&current->sighand->siglock);
mutex_lock(&tty_mutex);
@@ -2897,7 +2897,7 @@ static int tiocsctty(struct tty_struct *tty, int arg)
{
int ret = 0;
if (current->signal->leader &&
- (current->signal->session == tty->session))
+ (process_session(current) == tty->session))
return ret;
mutex_lock(&tty_mutex);
@@ -2979,13 +2979,13 @@ static int tiocspgrp(struct tty_struct *tty, struct tty_struct *real_tty, pid_t
return retval;
if (!current->signal->tty ||
(current->signal->tty != real_tty) ||
- (real_tty->session != current->signal->session))
+ (real_tty->session != process_session(current)))
return -ENOTTY;
if (get_user(pgrp, p))
return -EFAULT;
if (pgrp < 0)
return -EINVAL;
- if (session_of_pgrp(pgrp) != current->signal->session)
+ if (session_of_pgrp(pgrp) != process_session(current))
return -EPERM;
real_tty->pgrp = pgrp;
return 0;
@@ -3338,7 +3338,7 @@ static void __do_SAK(struct work_struct *work)
/* Kill the entire session */
do_each_task_pid(session, PIDTYPE_SID, p) {
printk(KERN_NOTICE "SAK: killed process %d"
- " (%s): p->signal->session==tty->session\n",
+ " (%s): process_session(p)==tty->session\n",
p->pid, p->comm);
send_sig(SIGKILL, p, 1);
} while_each_task_pid(session, PIDTYPE_SID, p);
@@ -3348,7 +3348,7 @@ static void __do_SAK(struct work_struct *work)
do_each_thread(g, p) {
if (p->signal->tty == tty) {
printk(KERN_NOTICE "SAK: killed process %d"
- " (%s): p->signal->session==tty->session\n",
+ " (%s): process_session(p)==tty->session\n",
p->pid, p->comm);
send_sig(SIGKILL, p, 1);
continue;