From: David van Moolenbroek Date: Tue, 1 Sep 2015 11:42:03 +0000 (+0000) Subject: VFS: workaround to allow TIOCSCTTY on PTYs X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=refs%2Fchanges%2F70%2F3070%2F1;p=minix.git 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 --- diff --git a/minix/servers/vfs/device.c b/minix/servers/vfs/device.c index 454f66554..54a1b0872 100644 --- a/minix/servers/vfs/device.c +++ b/minix/servers/vfs/device.c @@ -288,8 +288,9 @@ 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) { - fp->fp_tty = dev; + if (op == CDEV_IOCTL && bytes == TIOCSCTTY && + (major(dev) == TTY_MAJOR || major(dev) == PTY_MAJOR)) { + fp->fp_tty = dev; } /* Create a grant for the buffer provided by the user process. */