diff --git a/src/connector.c b/src/connector.c index 4b6b5fbf..df21489a 100644 --- a/src/connector.c +++ b/src/connector.c @@ -284,10 +284,8 @@ retry: cksleep_ms(100); goto retry; } - do { - ret = poll(fds, nfds, 1000); - } while (unlikely(ret < 0 && interrupted())); - if (ret < 0) { + ret = poll(fds, nfds, 1000); + if (unlikely(ret < 0)) { LOGERR("Failed to poll in receiver"); goto out; } diff --git a/src/libckpool.c b/src/libckpool.c index ab3f6056..c20d6ce2 100644 --- a/src/libckpool.c +++ b/src/libckpool.c @@ -615,7 +615,7 @@ int wait_read_select(int sockd, int timeout) FD_SET(sockd, &readfs); do { ret = select(sockd + 1, &readfs, NULL, NULL, &tv_timeout); - } while (unlikely(ret < 0 && interrupted())); + } while (unlikely(ret < 0)); return ret; } @@ -692,7 +692,7 @@ int wait_write_select(int sockd, int timeout) FD_SET(sockd, &writefds); do { ret = select(sockd + 1, NULL, &writefds, NULL, &tv_timeout); - } while (unlikely(ret < 0 && interrupted())); + } while (unlikely(ret < 0)); return ret; } diff --git a/src/libckpool.h b/src/libckpool.h index e2af60c9..1433bdcc 100644 --- a/src/libckpool.h +++ b/src/libckpool.h @@ -362,14 +362,11 @@ static inline bool sock_blocks(void) { return (errno == EAGAIN || errno == EWOULDBLOCK); } + static inline bool sock_timeout(void) { return (errno == ETIMEDOUT); } -static inline bool interrupted(void) -{ - return (errno == EINTR); -} bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port); void keep_sockalive(int fd);