[PATCH 1/2] tty: TIOCGSOFTCAR/SSOFTCAR on pty is wron

Previous thread: Re: [GIT PULL] block bits by Linus Torvalds on Tuesday, August 26, 2008 - 12:02 pm. (5 messages)

Next thread: [PATCH] UIO: Add of_platform_driver to uio_pdrv_genirq by Wolfram Sang on Tuesday, August 26, 2008 - 12:11 pm. (1 message)
From: Alan Cox
Date: Tuesday, August 26, 2008 - 11:52 am

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>
---

 drivers/char/tty_ioctl.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c
index ea9fc5d..bf34e45 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;
 	}
--

Previous thread: Re: [GIT PULL] block bits by Linus Torvalds on Tuesday, August 26, 2008 - 12:02 pm. (5 messages)

Next thread: [PATCH] UIO: Add of_platform_driver to uio_pdrv_genirq by Wolfram Sang on Tuesday, August 26, 2008 - 12:11 pm. (1 message)