commit ea938bbb0415e745bc969e4bf4123a41723e740f
Author:     Jan Klemkow <[email protected]>
AuthorDate: Thu Apr 16 23:17:30 2020 +0200
Commit:     Jan Klemkow <[email protected]>
CommitDate: Thu Apr 16 23:17:30 2020 +0200

    handle closing fds

diff --git a/scroll.c b/scroll.c
index 33dda40..3952a54 100644
--- a/scroll.c
+++ b/scroll.c
@@ -480,6 +480,9 @@ main(int argc, char *argv[])
                        doredraw = false;
                }
 
+               if (pfd[0].revents & POLLHUP || pfd[1].revents & POLLHUP)
+                       break;
+
                if (pfd[0].revents & POLLIN) {
                        ssize_t n = read(STDIN_FILENO, input, sizeof(input)-1);
 

Reply via email to