dienbk7x / picocom

Automatically exported from code.google.com/p/picocom
GNU General Public License v2.0
0 stars 0 forks source link

Cope with EAGAIN from read(2) #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Attachments:

GoogleCodeExporter commented 9 years ago
> In addition to coping with the above condition...

Nicely spotted!

Both fixed in r23

Original comment by nick.pat...@gmail.com on 21 Feb 2012 at 6:27