From e8d8fe5adac149168592d63c77b1e31b58f691bc Mon Sep 17 00:00:00 2001 From: Peter Tirsek Date: Tue, 25 Mar 2025 11:06:24 -0500 Subject: [PATCH] tritty: Fix "select: Interrupted system call" error When the terminal is resized, the process is sent a SIGWINCH, and although tritty catches and handles that signal appropriately, the select() system call is interrupted and must be restarted. --- tritty.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tritty.c b/tritty.c index a2548a3..984c0e7 100644 --- a/tritty.c +++ b/tritty.c @@ -109,6 +109,8 @@ main(int argc, char **argv) FD_SET(fdchild, &fdset); if (select(fdchild+1, &fdset, NULL, NULL, NULL) == -1) { + if (errno == EINTR) + continue; perror("select"); return 1; }