[PATCH 08/12] pty: Prepare to redefine tty driver remove() interface

From: Peter Hurley
Date: Fri Nov 27 2015 - 21:26:59 EST


BSD pty drivers are cross-linked at driver initialization and linked pairs
must have the same tty index; use this information to simplify clearing
the driver tables.

Signed-off-by: Peter Hurley <peter@xxxxxxxxxxxxxxxxxx>
---
drivers/tty/pty.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index be5020d..2680044 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -463,10 +463,8 @@ static int pty_install(struct tty_driver *driver, struct tty_struct *tty)

static void pty_remove(struct tty_driver *driver, struct tty_struct *tty)
{
- struct tty_struct *pair = tty->link;
driver->ttys[tty->index] = NULL;
- if (pair)
- pair->driver->ttys[pair->index] = NULL;
+ driver->other->ttys[tty->index] = NULL;
}

static int pty_bsd_ioctl(struct tty_struct *tty,
--
2.6.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/