From dfc517f6715ff239ac478a91ff017d526fdbcb5c Mon Sep 17 00:00:00 2001 From: Oleh Hushchenkov Date: Sun, 18 Apr 2021 13:56:56 +0300 Subject: [PATCH 1/2] 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); From e9dfb21022d4d3fcf8336289a87911aeafcc8f95 Mon Sep 17 00:00:00 2001 From: Oleh Hushchenkov Date: Sun, 18 Apr 2021 14:05:28 +0300 Subject: [PATCH 2/2] Fix comment --- terminal.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/terminal.c b/terminal.c index ef33d975..bcb8a868 100644 --- a/terminal.c +++ b/terminal.c @@ -248,9 +248,7 @@ 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 - */ + /* Reached end-of-file */ break; }