summary refs log tree commit diff
path: root/chat.c
diff options
context:
space:
mode:
authorCurtis McEnroe2018-08-04 15:04:48 -0400
committerCurtis McEnroe2018-08-04 15:04:48 -0400
commit39507f0f8fb59b8574361835edff86f2b0efbcb9 (patch)
treee114b7ed297cf6607d8fab4ba3c15695258292bd /chat.c
parent6e4f98d6eb3dee15a140647c033a87ca5e6c3064 (diff)
Handle terminal resizing
Diffstat (limited to 'chat.c')
-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();