It is always possible for read(2) to return -1 with errno set to EAGAIN when
reading from a non-blocking file descriptor, even if select(2) previously told
us it was ready. Catch this condition and do not treat it as a fatal error.
In addition to coping with the above condition, this patch also fixes a problem
encountered when select(2) returns read notifications for both STI and the tty,
and the data read from the STI caused the baud rate to be changed. This would
cause a tcflush() on the tty (which would drop any input data) immediately
before attempting to read(2) from that tty.
Original issue reported on code.google.com by lwith...@gmail.com on 12 Oct 2011 at 9:55
Original issue reported on code.google.com by
lwith...@gmail.com
on 12 Oct 2011 at 9:55Attachments: