From 2b7f62dbd486172de70bd740005af538e46567f7 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Sun, 20 Jun 2021 22:18:33 +0000 Subject: Handle EINTR from connect(2) gracefully Resizing the window early on may return early due to SIGWINCH. Continue asynchronously in that case instead of exiting. --- irc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/irc.c b/irc.c index 3f0de3c..41739a3 100644 --- a/irc.c +++ b/irc.c @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -148,6 +149,7 @@ int ircConnect(const char *bindHost, const char *host, const char *port) { error = connect(sock, ai->ai_addr, ai->ai_addrlen); if (!error) break; + if (error && errno == EINTR) break; // connect continues asynchronously close(sock); sock = -1; -- cgit 1.4.1-2-gfad0