lkml.org 
[lkml]   [2014]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/1] tty: Fix pty master poll() after slave closes
From
Hi Peter,
thanks for your reply.

>> poll_wait(file, &tty->read_wait, wait);
>> poll_wait(file, &tty->write_wait, wait);
>> - if (input_available_p(tty, 1))
>> - mask |= POLLIN | POLLRDNORM;
>> if (tty->packet && tty->link->ctrl_status)
>> mask |= POLLPRI | POLLIN | POLLRDNORM;
>> if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
>> mask |= POLLHUP;
>> if (tty_hung_up_p(file))
>> mask |= POLLHUP;
>> + if (mask & POLLHUP)
>> + tty_flush_to_ldisc(tty);
>
> This isn't necessary for the tty_hung_up_p() case because, when the
> poll() is woken from hangup, the read buffer has already been flushed (ie.,
> cleared).
>
> Plus, this waits even if input_available_p() would already return true.
>

Let me work on a patch for stable along the lines you suggest.

Francesco


\
 
 \ /
  Last update: 2014-10-09 20:22    [W:0.040 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site