From 39507f0f8fb59b8574361835edff86f2b0efbcb9 Mon Sep 17 00:00:00 2001 From: Curtis McEnroe Date: Sat, 4 Aug 2018 15:04:48 -0400 Subject: Handle terminal resizing --- chat.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'chat.c') diff --git a/chat.c b/chat.c index dc45312..ab0d4d7 100644 --- a/chat.c +++ b/chat.c @@ -80,8 +80,11 @@ int main(int argc, char *argv[]) { }; for (;;) { int nfds = poll(fds, 2, -1); - if (nfds < 0 && errno == EINTR) continue; - if (nfds < 0) err(EX_IOERR, "poll"); + if (nfds < 0) { + if (errno != EINTR) err(EX_IOERR, "poll"); + fds[0].revents = POLLIN; + fds[1].revents = 0; + } if (fds[0].revents) uiRead(); if (fds[1].revents) clientRead(); -- cgit 1.4.1