Messages in this thread Patch in this message | | | From | Peter Hurley <> | Subject | [PATCH 08/12] pty: Prepare to redefine tty driver remove() interface | Date | Fri, 27 Nov 2015 21:25:53 -0500 |
| |
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@hurleysoftware.com> --- 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
| |