lkml.org 
[lkml]   [2012]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty: Fix unreasonable write toward closed pty.
> 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


\
 
 \ /
  Last update: 2012-12-19 20:21    [W:0.053 / U:2.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site