summaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-09-19 19:15:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-09-19 19:15:08 +0000
commit03ba4131783cc9e872f8bb26a03f15bc11f27564 (patch)
tree88db8dba75ae06ba3bad08e42c5e52efc162535c /drivers/char/tty_io.c
parent257730f99381dd26e10b832fce4c94cae7ac1176 (diff)
- Merge with Linux 2.1.121.
- Bugfixes.
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index a26ce1311..d2ecd8183 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -128,7 +128,7 @@ static int tty_open(struct inode *, struct file *);
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 file * filp, int on);
+static int tty_fasync(int fd, struct file * filp, int on);
#ifdef CONFIG_8xx
extern long console_8xx_init(void);
extern int rs_8xx_init(void);
@@ -358,6 +358,7 @@ static struct file_operations tty_fops = {
tty_ioctl,
NULL, /* tty_mmap */
tty_open,
+ NULL, /* flush */
tty_release,
NULL, /* tty_fsync */
tty_fasync
@@ -372,6 +373,7 @@ static struct file_operations hung_up_tty_fops = {
hung_up_tty_ioctl,
NULL, /* hung_up_tty_mmap */
NULL, /* hung_up_tty_open */
+ NULL, /* flush */
tty_release, /* hung_up_tty_release */
NULL, /* hung_up_tty_fsync */
NULL /* hung_up_tty_fasync */
@@ -409,7 +411,7 @@ void do_tty_hangup(void *data)
continue;
if (filp->f_op != &tty_fops)
continue;
- tty_fasync(filp, 0);
+ tty_fasync(-1, filp, 0);
filp->f_op = &hung_up_tty_fops;
}
@@ -983,7 +985,7 @@ static void release_dev(struct file * filp)
check_tty_count(tty, "release_dev");
- tty_fasync(filp, 0);
+ tty_fasync(-1, filp, 0);
idx = MINOR(tty->device) - tty->driver.minor_start;
pty_master = (tty->driver.type == TTY_DRIVER_TYPE_PTY &&
@@ -1352,7 +1354,7 @@ static unsigned int tty_poll(struct file * filp, poll_table * wait)
* 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 file * filp, int on, struct fasync_struct **fapp)
+int fasync_helper(int fd, struct file * filp, int on, struct fasync_struct **fapp)
{
struct fasync_struct *fa, **fp;
unsigned long flags;
@@ -1363,13 +1365,16 @@ int fasync_helper(struct file * filp, int on, struct fasync_struct **fapp)
}
if (on) {
- if (fa)
+ if (fa) {
+ fa->fa_fd = fd;
return 0;
+ }
fa = (struct fasync_struct *)kmalloc(sizeof(struct fasync_struct), GFP_KERNEL);
if (!fa)
return -ENOMEM;
fa->magic = FASYNC_MAGIC;
fa->fa_file = filp;
+ fa->fa_fd = fd;
save_flags(flags);
cli();
fa->fa_next = *fapp;
@@ -1387,7 +1392,7 @@ int fasync_helper(struct file * filp, int on, struct fasync_struct **fapp)
return 1;
}
-static int tty_fasync(struct file * filp, int on)
+static int tty_fasync(int fd, struct file * filp, int on)
{
struct tty_struct * tty;
int retval;
@@ -1396,7 +1401,7 @@ static int tty_fasync(struct file * filp, int on)
if (tty_paranoia_check(tty, filp->f_dentry->d_inode->i_rdev, "tty_fasync"))
return 0;
- retval = fasync_helper(filp, on, &tty->fasync);
+ retval = fasync_helper(fd, filp, on, &tty->fasync);
if (retval <= 0)
return retval;
@@ -1973,7 +1978,7 @@ int tty_unregister_driver(struct tty_driver *driver)
* Just do some early initializations, and do the complex setup
* later.
*/
-long console_init(long kmem_start, long kmem_end)
+long __init console_init(long kmem_start, long kmem_end)
{
/* Setup the default TTY line discipline. */
memset(ldiscs, 0, sizeof(ldiscs));