summaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-08-26 20:52:47 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2008-08-27 23:37:09 +0200
commitf753f3272b4d2108d1e4b121ddcde504737a8693 (patch)
tree8cb292ba9bd8249c578fdb77f49d7343beaa7815 /drivers/char
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 (diff)
downloadlinux-f753f3272b4d2108d1e4b121ddcde504737a8693.tar.xz
linux-f753f3272b4d2108d1e4b121ddcde504737a8693.zip
tty: TIOCGSOFTCAR/SSOFTCAR on pty is wron
The termios settings ioctls on a pty should affect the bound tty side not the pty. The SOFTCAR ioctls use the wrong device file. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/tty_ioctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index ea9fc5d03b99..bf34e4597421 100644
--- a/drivers/char/tty_ioctl.c
+++ b/drivers/char/tty_ioctl.c
@@ -937,12 +937,14 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
return 0;
#endif
case TIOCGSOFTCAR:
- return put_user(C_CLOCAL(tty) ? 1 : 0,
+ /* FIXME: for correctness we may need to take the termios
+ lock here - review */
+ return put_user(C_CLOCAL(real_tty) ? 1 : 0,
(int __user *)arg);
case TIOCSSOFTCAR:
if (get_user(arg, (unsigned int __user *) arg))
return -EFAULT;
- return tty_change_softcar(tty, arg);
+ return tty_change_softcar(real_tty, arg);
default:
return -ENOIOCTLCMD;
}