From dfc517f6715ff239ac478a91ff017d526fdbcb5c Mon Sep 17 00:00:00 2001 From: Oleh Hushchenkov Date: Sun, 18 Apr 2021 13:56:56 +0300 Subject: [PATCH] term: stop reading on eof --- terminal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/terminal.c b/terminal.c index e55230b4..ef33d975 100644 --- a/terminal.c +++ b/terminal.c @@ -247,6 +247,11 @@ fdm_ptmx(struct fdm *fdm, int fd, int events, void *data) LOG_ERRNO("failed to read from pseudo terminal"); return false; + } else if (count == 0) { + /* + * Reached end-of-file + */ + break; } vt_from_slave(term, buf, count);