summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/irixioctl.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-09-28 22:25:29 +0000
commit0ae8dceaebe3659ee0c3352c08125f403e77ebca (patch)
tree5085c389f09da78182b899d19fe1068b619a69dd /arch/mips/kernel/irixioctl.c
parent273767781288c35c9d679e908672b9996cda4c34 (diff)
Merge with 2.3.10.
Diffstat (limited to 'arch/mips/kernel/irixioctl.c')
-rw-r--r--arch/mips/kernel/irixioctl.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/arch/mips/kernel/irixioctl.c b/arch/mips/kernel/irixioctl.c
index c05c6609a..10ca5b15e 100644
--- a/arch/mips/kernel/irixioctl.c
+++ b/arch/mips/kernel/irixioctl.c
@@ -1,4 +1,4 @@
-/* $Id: irixioctl.c,v 1.5 1999/02/01 01:28:55 ralf Exp $
+/* $Id: irixioctl.c,v 1.6 1999/02/06 05:12:56 adevries Exp $
* irixioctl.c: A fucking mess...
*
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
@@ -29,20 +29,21 @@ extern asmlinkage int sys_ioctl(unsigned int fd, unsigned int cmd,
unsigned long arg);
extern asmlinkage int sys_write(unsigned int fd,char * buf,unsigned int count);
extern void start_tty(struct tty_struct *tty);
-
static struct tty_struct *get_tty(int fd)
{
struct file *filp;
+ struct tty_struct *ttyp = NULL;
- if(!(filp = fcheck(fd)))
- return ((struct tty_struct *) 0);
- if(filp->private_data) {
- struct tty_struct *ttyp = (struct tty_struct *) filp->private_data;
+ read_lock(&current->files->file_lock);
+ filp = fcheck(fd);
+ if(filp && filp->private_data) {
+ ttyp = (struct tty_struct *) filp->private_data;
- if(ttyp->magic == TTY_MAGIC)
- return ttyp;
+ if(ttyp->magic != TTY_MAGIC)
+ ttyp =NULL;
}
- return ((struct tty_struct *) 0);
+ read_unlock(&current->files->file_lock);
+ return ttyp;
}
static struct tty_struct *get_real_tty(struct tty_struct *tp)