--- linux/kernel/chr_drv/vt.c 2018/04/24 18:13:45 1.1.1.3 +++ linux/kernel/chr_drv/vt.c 2018/04/24 18:15:42 1.1.1.4 @@ -10,13 +10,13 @@ #include #include #include +#include +#include #include #include #include "vt_kern.h" -#include -#include /* * console (vt and kd) routines, as defined by usl svr4 manual @@ -63,16 +63,18 @@ kiocsound(unsigned int freq) } /* - * all the vt ioctls affect only consoles, so we reject all other ttys. - * we also have the capability to modify any console, not just the fg_console. + * We handle the console-specific ioctl's here. We allow the + * capability to modify any console, not just the fg_console. */ -int -vt_ioctl(struct tty_struct *tty, int dev, int cmd, int arg) +int vt_ioctl(struct tty_struct *tty, struct file * file, + unsigned int cmd, unsigned int arg) { - int console = dev ? dev - 1 : fg_console; + int console; unsigned char ucval; - if (!IS_A_CONSOLE(dev) || console < 0 || console >= NR_CONSOLES) + console = tty->line - 1; + + if (console < 0 || console >= NR_CONSOLES) return -EINVAL; switch (cmd) {