patch-2.1.56 linux/drivers/char/tty_io.c
Next file: linux/drivers/char/vc_screen.c
Previous file: linux/drivers/char/tpqic02.c
Back to the patch index
Back to the overall index
- Lines: 81
- Date:
Tue Sep 16 09:54:26 1997
- Orig file:
v2.1.55/linux/drivers/char/tty_io.c
- Orig date:
Mon Aug 4 16:25:37 1997
diff -u --recursive --new-file v2.1.55/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
@@ -115,7 +115,7 @@
static int tty_release(struct inode *, struct file *);
static int tty_ioctl(struct inode * inode, struct file * file,
unsigned int cmd, unsigned long arg);
-static int tty_fasync(struct inode * inode, struct file * filp, int on);
+static int tty_fasync(struct file * filp, int on);
#ifndef MIN
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -327,8 +327,7 @@
return cmd == TIOCSPGRP ? -ENOTTY : -EIO;
}
-static long long tty_lseek(struct inode * inode, struct file * file,
- long long offset, int orig)
+static long long tty_lseek(struct file * file, long long offset, int orig)
{
return -ESPIPE;
}
@@ -381,7 +380,7 @@
continue;
if (filp->f_op != &tty_fops)
continue;
- tty_fasync(filp->f_dentry->d_inode, filp, 0);
+ tty_fasync(filp, 0);
filp->f_op = fops;
}
@@ -926,7 +925,7 @@
check_tty_count(tty, "release_dev");
- tty_fasync(filp->f_dentry->d_inode, filp, 0);
+ tty_fasync(filp, 0);
idx = MINOR(tty->device) - tty->driver.minor_start;
pty_master = (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
@@ -1263,7 +1262,7 @@
* to set up the fasync queue. It returns negative on error, 0 if it did
* no changes and positive if it added/deleted the entry.
*/
-int fasync_helper(struct inode * inode, struct file * filp, int on, struct fasync_struct **fapp)
+int fasync_helper(struct file * filp, int on, struct fasync_struct **fapp)
{
struct fasync_struct *fa, **fp;
unsigned long flags;
@@ -1298,27 +1297,26 @@
return 1;
}
-static int tty_fasync(struct inode * inode, struct file * filp, int on)
+static int tty_fasync(struct file * filp, int on)
{
struct tty_struct * tty;
int retval;
tty = (struct tty_struct *)filp->private_data;
- if (tty_paranoia_check(tty, inode->i_rdev, "tty_fasync"))
+ if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "tty_fasync"))
return 0;
- retval = fasync_helper(inode, filp, on, &tty->fasync);
+ retval = fasync_helper(filp, on, &tty->fasync);
if (retval <= 0)
return retval;
if (on) {
if (!waitqueue_active(&tty->read_wait))
tty->minimum_to_wake = 1;
- if (filp->f_owner == 0) {
- if (tty->pgrp)
- filp->f_owner = -tty->pgrp;
- else
- filp->f_owner = current->pid;
+ if (filp->f_owner.pid == 0) {
+ filp->f_owner.pid = (-tty->pgrp) ? : current->pid;
+ filp->f_owner.uid = current->uid;
+ filp->f_owner.euid = current->euid;
}
} else {
if (!tty->fasync && !waitqueue_active(&tty->read_wait))
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov