Re: [PATCH 1/1] tty: Fix pty master poll() after slave closes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux