From bb75b1df4ec7b19cc26a4fdd7cb7d770ed2f454a Mon Sep 17 00:00:00 2001 From: Aleksey Shargalin Date: Thu, 21 Jun 2018 18:24:31 +0300 Subject: [PATCH] Fix receiving after fifo overrun After fifo overrun buffer_done remains less than buffer_len and FD_SET(p->port[ti].s, &read_set) is not called. If firmware has nothing to send, select always returns 0 and new data is never read even if fifo buffer gets flushed. This patch removes check for select timeout, so the remaining data in buffer may go to fifo. --- examples/parts/uart_pty.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/parts/uart_pty.c b/examples/parts/uart_pty.c index 632dbdc..3282ac9 100644 --- a/examples/parts/uart_pty.c +++ b/examples/parts/uart_pty.c @@ -175,8 +175,6 @@ uart_pty_thread( struct timeval timo = { 0, 500 }; int ret = select(max+1, &read_set, &write_set, NULL, &timo); - if (!ret) - continue; if (ret < 0) break; -- 2.39.5