[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1359567832-25318-5-git-send-email-peter@hurleysoftware.com>
Date: Wed, 30 Jan 2013 12:43:52 -0500
From: Peter Hurley <peter@...leysoftware.com>
To: Ilya Zykov <ilya@...x.ru>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Alan Cox <alan@...ux.intel.com>, linux-serial@...r.kernel.org,
linux-kernel@...r.kernel.org, Jiri Slaby <jslaby@...e.cz>,
Peter Hurley <peter@...leysoftware.com>
Subject: [PATCH 4/4] pty: Ignore slave open count for master pty open
Multiple slave pty opens may be performed in parallel with the
master open. Of course, all the slave opens will fail because the
master pty is still locked but during this time the slave pty
count will be artificially greater than 1. This is should not
cause the master pty open to fail.
Signed-off-by: Peter Hurley <peter@...leysoftware.com>
---
drivers/tty/pty.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index 6eb3e80..7a18600 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -256,7 +256,7 @@ static int pty_open(struct tty_struct *tty, struct file *filp)
goto out;
if (test_bit(TTY_PTY_LOCK, &tty->link->flags))
goto out;
- if (tty->link->count != 1)
+ if (tty->driver->subtype == PTY_TYPE_SLAVE && tty->link->count != 1)
goto out;
clear_bit(TTY_IO_ERROR, &tty->flags);
--
1.8.1.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists