From: Tony Breeds Date: Sat, 15 Sep 2007 00:03:01 +0000 (-0700) Subject: sparc64 (and others): fix tty_ioctl.c build X-Git-Tag: v2.6.23-rc7~42 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=commitdiff_plain;h=bb8bd3a52a5dbca8bea31bfc72dacfb384170e69 sparc64 (and others): fix tty_ioctl.c build Add Guards around TIOCSLCKTRMIOS and TIOCGLCKTRMIOS. Several architectures are still broken. Put temporary-for-2.6.23 ifdef guards around the offending code. Signed-off-by: Tony Breeds Cc: Alan Cox Cc: Paul Mackerras Cc: Benjamin Herrenschmidt Cc: Heiko Carstens Cc: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by:: Linus Torvalds --- diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 4a8969cef315..3ee73cf64bd2 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c @@ -795,6 +795,19 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, if (L_ICANON(tty)) retval = inq_canon(tty); return put_user(retval, (unsigned int __user *) arg); +#ifndef TCGETS2 + case TIOCGLCKTRMIOS: + if (kernel_termios_to_user_termios((struct termios __user *)arg, real_tty->termios_locked)) + return -EFAULT; + return 0; + + case TIOCSLCKTRMIOS: + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + if (user_termios_to_kernel_termios(real_tty->termios_locked, (struct termios __user *) arg)) + return -EFAULT; + return 0; +#else case TIOCGLCKTRMIOS: if (kernel_termios_to_user_termios_1((struct termios __user *)arg, real_tty->termios_locked)) return -EFAULT; @@ -806,6 +819,7 @@ int n_tty_ioctl(struct tty_struct * tty, struct file * file, if (user_termios_to_kernel_termios_1(real_tty->termios_locked, (struct termios __user *) arg)) return -EFAULT; return 0; +#endif case TIOCPKT: {