From 4b12166f268352284014ecf4184d0132c4bedb45 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Tue, 1 Sep 2015 11:42:03 +0000 Subject: [PATCH] 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 --- minix/servers/vfs/device.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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. */