patch-2.1.77 linux/drivers/char/tty_io.c

Next file: linux/drivers/char/vc_screen.c
Previous file: linux/drivers/char/pms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.76/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
@@ -1548,12 +1548,16 @@
 		switch(cmd) {
 		case TIOCSBRK:
 		case TIOCCBRK:
-			return tty->driver.ioctl(tty, file, cmd, arg);
+			if (tty->driver.ioctl)
+				return tty->driver.ioctl(tty, file, cmd, arg);
+			return -EINVAL;
 			
 		/* These two ioctl's always return success; even if */
 		/* the driver doesn't support them. */
 		case TCSBRK:
-		case TCSBRKP:			
+		case TCSBRKP:
+			if (!tty->driver.ioctl)
+				return 0;
 			retval = tty->driver.ioctl(tty, file, cmd, arg);
 			if (retval == -ENOIOCTLCMD)
 				retval = 0;

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