mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-21 22:28:37 -05:00
David Laight reports that sometimes reads on a serial port will
attempt to block, and hence return EAGAIN/EWOULDBLOCK, in spite of the port having been reported readable by select(2). Don't treat those errors as fatal. [originally from svn r9020]
This commit is contained in:
parent
942ac83108
commit
0fc1f78677
@ -342,6 +342,14 @@ static int serial_select_result(int fd, int event)
|
|||||||
*/
|
*/
|
||||||
finished = TRUE;
|
finished = TRUE;
|
||||||
} else if (ret < 0) {
|
} else if (ret < 0) {
|
||||||
|
#ifdef EAGAIN
|
||||||
|
if (errno == EAGAIN)
|
||||||
|
return 1; /* spurious */
|
||||||
|
#endif
|
||||||
|
#ifdef EWOULDBLOCK
|
||||||
|
if (errno == EWOULDBLOCK)
|
||||||
|
return 1; /* spurious */
|
||||||
|
#endif
|
||||||
perror("read serial port");
|
perror("read serial port");
|
||||||
exit(1);
|
exit(1);
|
||||||
} else if (ret > 0) {
|
} else if (ret > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user