summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-08-04 15:04:48 -0400
committerJune McEnroe <june@causal.agency>2018-08-04 15:04:48 -0400
commit39507f0f8fb59b8574361835edff86f2b0efbcb9 (patch)
treee114b7ed297cf6607d8fab4ba3c15695258292bd /chat.c
parentHandle /names and /who (diff)
downloadcatgirl-39507f0f8fb59b8574361835edff86f2b0efbcb9.tar.gz
catgirl-39507f0f8fb59b8574361835edff86f2b0efbcb9.zip
Handle terminal resizing
Diffstat (limited to '')
-rw-r--r--chat.c7
1 files changed, 5 insertions, 2 deletions
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();