--- linux/kernel/chr_drv/vt.c 2018/04/24 18:10:13 1.1.1.2 +++ linux/kernel/chr_drv/vt.c 2018/04/24 18:15:42 1.1.1.4 @@ -1,22 +1,20 @@ /* * kernel/chr_drv/vt.c * - * (C) 1992 obz under the linux copyright + * Copyright (C) 1992 obz under the linux copyright */ -#include - -#include -#include -#include - -#include -#include - +#include +#include #include #include #include #include +#include +#include + +#include +#include #include "vt_kern.h" @@ -65,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) {