From: Roberto E. Vargas Caballero Date: Fri, 10 Apr 2020 20:25:46 +0000 (+0200) Subject: ttyread: test for EOF while reading tty X-Git-Url: https://git.danieliu.xyz/?a=commitdiff_plain;h=e52319cc7d153e4f59b38c4fb4c0556e118d4775;hp=e52319cc7d153e4f59b38c4fb4c0556e118d4775;p=st.git ttyread: test for EOF while reading tty When a read operation returns 0 then it means that we arrived to the end of the file, and new reads will return 0 unless you do some other operation such as lseek(). This case happens with USB-232 adapters when they are unplugged. ---