patch-2.2.8 linux/arch/mips/kernel/irixioctl.c

Next file: linux/arch/mips/kernel/sysirix.c
Previous file: linux/arch/m68k/sun3x/time.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.7/linux/arch/mips/kernel/irixioctl.c linux/arch/mips/kernel/irixioctl.c
@@ -33,13 +33,15 @@
 {
 	struct file *filp;
 
-	if(fd >= NR_OPEN || !(filp = current->files->fd[fd]))
+	file = fcheck(fd);
+	if(!file)
 		return ((struct tty_struct *) 0);
 	if(filp->private_data) {
 		struct tty_struct *ttyp = (struct tty_struct *) filp->private_data;
 
-		if(ttyp->magic == TTY_MAGIC)
+		if(ttyp->magic == TTY_MAGIC) {
 			return ttyp;
+		}
 	}
 	return ((struct tty_struct *) 0);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)