Thread (4 messages) 4 messages, 3 authors, 2012-12-21

Re: [PATCH] tty: Fix unreasonable write toward closed pty.

From: Alan Cox <hidden>
Date: 2012-12-19 19:06:17
Also in: lkml

quoted hunk ↗ jump to hunk
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index a82b399..1ce1362 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -116,6 +116,8 @@ static int pty_space(struct tty_struct *to)
 
 static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
 {
+	if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
+		return -EIO;
The flag can change between the test and ny further code being executed ?

Alan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help