patch-2.1.45 linux/arch/sparc64/kernel/ioctl32.c

Next file: linux/arch/sparc64/kernel/irq.c
Previous file: linux/arch/sparc64/kernel/entry.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/arch/sparc64/kernel/ioctl32.c linux/arch/sparc64/kernel/ioctl32.c
@@ -1,4 +1,4 @@
-/* $Id: ioctl32.c,v 1.11 1997/06/16 11:05:00 jj Exp $
+/* $Id: ioctl32.c,v 1.13 1997/07/17 02:20:38 davem Exp $
  * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
  *
  * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -22,6 +22,7 @@
 #include <linux/netlink.h>
 #include <linux/vt.h>
 #include <linux/fs.h>
+#include <linux/fd.h>
 
 #include <asm/types.h>
 #include <asm/uaccess.h>
@@ -485,8 +486,13 @@
 	int error = -EBADF;
 
 	lock_kernel();
-	if (fd >= NR_OPEN || !(filp = current->files->fd[fd]))
+	if(fd >= NR_OPEN)
 		goto out;
+
+	filp = current->files->fd[fd];
+	if(!filp)
+		goto out;
+
 	if (!filp->f_op || !filp->f_op->ioctl) {
 		error = sys_ioctl (fd, cmd, (unsigned long)arg);
 		goto out;
@@ -612,6 +618,15 @@
 	case FIBMAP:
 	case FIGETBSZ:
 	
+	/* 0x02 -- Floppy ioctls */
+	case FDSETEMSGTRESH:
+	case FDFLUSH:
+	case FDSETMAXERRS:
+	case FDGETMAXERRS:
+	case FDGETDRVTYP:
+	case FDEJECT:
+	/* XXX The rest need struct floppy_* translations. */
+
 	/* 0x12 */
 	case BLKRRPART:
 	case BLKFLSBUF:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov