提交 f753f327 编写于 作者: A Alan Cox 提交者: Linus Torvalds

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: NAlan Cox <alan@redhat.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 325a9a3d
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册