Skip to content

Commit

Permalink
tty: TIOCGSOFTCAR/SSOFTCAR on pty is wron
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Aug 27, 2008
1 parent 325a9a3 commit f753f32
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/char/tty_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit f753f32

Please sign in to comment.