VFS: workaround to allow TIOCSCTTY on PTYs

Fix /dev/tty-related issues in tmux(1) by hardcoding the PTY major
in VFS in addition to the TTY major.  Even though this is exactly
what we did NOT want to have to do, the actual fix for this issue
is going to take a little longer.

Change-Id: I24c75eaf688b9ebd28e931f2e445b8442cfdac78
This commit is contained in:
David van Moolenbroek 2015-09-01 11:42:03 +00:00
parent 29e004d23b
commit 4b12166f26

View file

@ -288,7 +288,8 @@ int cdev_io(
/* Handle TIOCSCTTY ioctl: set controlling tty.
* TODO: cleaner implementation work in progress.
*/
if (op == CDEV_IOCTL && bytes == TIOCSCTTY && major(dev) == TTY_MAJOR) {
if (op == CDEV_IOCTL && bytes == TIOCSCTTY &&
(major(dev) == TTY_MAJOR || major(dev) == PTY_MAJOR)) {
fp->fp_tty = dev;
}