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

Next file: linux/arch/sparc64/kernel/sys_sparc32.c
Previous file: linux/arch/sparc64/kernel/sparc64_ksyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/arch/sparc64/kernel/sunos_ioctl32.c linux/arch/sparc64/kernel/sunos_ioctl32.c
@@ -1,4 +1,4 @@
-/* $Id: sunos_ioctl32.c,v 1.2 1997/07/05 07:09:16 davem Exp $
+/* $Id: sunos_ioctl32.c,v 1.4 1997/07/17 02:20:43 davem Exp $
  * sunos_ioctl32.c: SunOS ioctl compatability on sparc64.
  *
  * Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
@@ -86,14 +86,19 @@
 extern asmlinkage int sys32_ioctl(unsigned int, unsigned int, u32);
 extern asmlinkage int sys_setsid(void);
 
-asmlinkage int sunos_ioctl (int fd, unsigned long cmd, u32 arg)
+asmlinkage int sunos_ioctl (int fd, u32 cmd, u32 arg)
 {
 	struct file *filp;
 	int ret = -EBADF;
 
 	lock_kernel();
-	if(fd >= SUNOS_NR_OPEN || !(filp = current->files->fd[fd]))
+	if(fd >= SUNOS_NR_OPEN)
 		goto out;
+
+	filp = current->files->fd[fd];
+	if(!filp)
+		goto out;
+
 	if(cmd == TIOCSETD) {
 		unsigned long old_fs = get_fs();
 		int *p, ntty = N_TTY;

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