diff options
author | Alan Cox <alan@redhat.com> | 2008-10-13 05:36:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-13 12:51:40 -0400 |
commit | e6885107736a4dd23e7d3bc103fe6d043c63c4de (patch) | |
tree | 77454a1a03bd0021945e3e6ef08b6f39ef8dbf14 /drivers | |
parent | b70ac7718579b5cbf3bdd74fd01132d1c91596f4 (diff) |
tty: move tioclinux from a special case
Right now we have ifdefs and hooks in the core ioctl handler for TIOCLINUX
and then test if its a console. This is brain dead. Instead call the
tioclinux helper from the relevant driver ioctl methods.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tty_io.c | 4 | ||||
-rw-r--r-- | drivers/char/vt.c | 2 | ||||
-rw-r--r-- | drivers/char/vt_ioctl.c | 2 |
3 files changed, 2 insertions, 6 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index e4dce8709541..2f05728920e7 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -3026,10 +3026,6 @@ long tty_ioctl(struct file *file, unsigned int cmd, unsigned long arg) | |||
3026 | return put_user(tty->ldisc.ops->num, (int __user *)p); | 3026 | return put_user(tty->ldisc.ops->num, (int __user *)p); |
3027 | case TIOCSETD: | 3027 | case TIOCSETD: |
3028 | return tiocsetd(tty, p); | 3028 | return tiocsetd(tty, p); |
3029 | #ifdef CONFIG_VT | ||
3030 | case TIOCLINUX: | ||
3031 | return tioclinux(tty, arg); | ||
3032 | #endif | ||
3033 | /* | 3029 | /* |
3034 | * Break handling | 3030 | * Break handling |
3035 | */ | 3031 | */ |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 60359c360912..05ca1c5dcb1c 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -2583,8 +2583,6 @@ int tioclinux(struct tty_struct *tty, unsigned long arg) | |||
2583 | int lines; | 2583 | int lines; |
2584 | int ret; | 2584 | int ret; |
2585 | 2585 | ||
2586 | if (tty->driver->type != TTY_DRIVER_TYPE_CONSOLE) | ||
2587 | return -EINVAL; | ||
2588 | if (current->signal->tty != tty && !capable(CAP_SYS_ADMIN)) | 2586 | if (current->signal->tty != tty && !capable(CAP_SYS_ADMIN)) |
2589 | return -EPERM; | 2587 | return -EPERM; |
2590 | if (get_user(type, p)) | 2588 | if (get_user(type, p)) |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index c904e9ad4a71..8944ce508e2f 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -395,6 +395,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, | |||
395 | 395 | ||
396 | kbd = kbd_table + console; | 396 | kbd = kbd_table + console; |
397 | switch (cmd) { | 397 | switch (cmd) { |
398 | case TIOCLINUX: | ||
399 | return tioclinux(tty, arg); | ||
398 | case KIOCSOUND: | 400 | case KIOCSOUND: |
399 | if (!perm) | 401 | if (!perm) |
400 | goto eperm; | 402 | goto eperm; |