aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_ioctl.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-10-13 09:43:54 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-10-13 09:43:54 -0400
commitb160292cc216a50fd0cd386b0bda2cd48352c73b (patch)
treeef07cf98f91353ee4c9ec1e1ca7a2a5d9d4b538a /drivers/char/tty_ioctl.c
parentb37bde147890c8fea8369a5a4e230dabdea4ebfb (diff)
parentbbf25010f1a6b761914430f5fca081ec8c7accd1 (diff)
Merge Linux 2.6.23
Diffstat (limited to 'drivers/char/tty_ioctl.c')
-rw-r--r--drivers/char/tty_ioctl.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index 3423e9ee6481..3ee73cf64bd2 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -795,6 +795,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
795 if (L_ICANON(tty)) 795 if (L_ICANON(tty))
796 retval = inq_canon(tty); 796 retval = inq_canon(tty);
797 return put_user(retval, (unsigned int __user *) arg); 797 return put_user(retval, (unsigned int __user *) arg);
798#ifndef TCGETS2
798 case TIOCGLCKTRMIOS: 799 case TIOCGLCKTRMIOS:
799 if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) 800 if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked))
800 return -EFAULT; 801 return -EFAULT;
@@ -806,6 +807,19 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file,
806 if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) 807 if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg))
807 return -EFAULT; 808 return -EFAULT;
808 return 0; 809 return 0;
810#else
811 case TIOCGLCKTRMIOS:
812 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked))
813 return -EFAULT;
814 return 0;
815
816 case TIOCSLCKTRMIOS:
817 if (!capable(CAP_SYS_ADMIN))
818 return -EPERM;
819 if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg))
820 return -EFAULT;
821 return 0;
822#endif
809 823
810 case TIOCPKT: 824 case TIOCPKT:
811 { 825 {