From eaf30f067ca023b35ea10d1805007a491609d90e Mon Sep 17 00:00:00 2001 From: Frank Rolsted Jensen Date: Wed, 27 Oct 2021 15:44:09 +0200 Subject: [PATCH] Clear pollin flag when input buffer is flushed The pollin flag must be cleared when the input buffer (pty slave) is flushed. This ensures that the POLLIN event is not signaled to the application, when there is not data to read. --- src/ttynvt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ttynvt.c b/src/ttynvt.c index 3e502cd..8d33a24 100644 --- a/src/ttynvt.c +++ b/src/ttynvt.c @@ -918,6 +918,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg, case TCIFLUSH: byte = 1; tty->slave_suspended = 0; /* Re-enable polling of Slave */ + tty->pollin = 0; break; case TCOFLUSH: byte = 2; @@ -927,6 +928,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg, byte = 3; tty->slave_suspended = 0; /* Re-enable polling of Slave */ tty->pollout = 1; + tty->pollin = 0; break; } telnet_rfc2217_cfg(tty->tn, TNS_SET_PURGE, &byte, 1);