• Peter Hurley's avatar
    pty: Ignore slave pty close() if never successfully opened · 69939035
    Peter Hurley authored
    If the master and slave ptys are opened in parallel, the slave open
    fails because the pty is still locked. This is as designed.
    However, pty_close() is still called for the slave pty which sets
    TTY_OTHER_CLOSED in the master pty. This can cause the master open
    to fail as well.
    
    Use a common pattern in other tty drivers by setting TTY_IO_ERROR
    until the open is successful and only closing the pty if not set.
    
    Note: the master pty always closes regardless of whether the open
    was successful, so that proper cleanup can occur.
    Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    69939035
pty.c 20.6 KB