فهرست منبع

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>
Alan Cox 16 سال پیش
والد
کامیت
f753f3272b
1فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 4 2
      drivers/char/tty_ioctl.c

+ 4 - 2
drivers/char/tty_ioctl.c

@@ -937,12 +937,14 @@ int tty_mode_ioctl(struct tty_struct *tty, struct file *file,
 			return 0;
 			return 0;
 #endif
 #endif
 	case TIOCGSOFTCAR:
 	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);
 						(int __user *)arg);
 	case TIOCSSOFTCAR:
 	case TIOCSSOFTCAR:
 		if (get_user(arg, (unsigned int __user *) arg))
 		if (get_user(arg, (unsigned int __user *) arg))
 			return -EFAULT;
 			return -EFAULT;
-		return tty_change_softcar(tty, arg);
+		return tty_change_softcar(real_tty, arg);
 	default:
 	default:
 		return -ENOIOCTLCMD;
 		return -ENOIOCTLCMD;
 	}
 	}