Browse Source

Remove all handling of interrupted calls which may have been blocking appropriate failure modes

master
Con Kolivas 10 years ago
parent
commit
5b2b4c73ef
  1. 6
      src/connector.c
  2. 4
      src/libckpool.c
  3. 5
      src/libckpool.h

6
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;
}

4
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;
}

5
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);

Loading…
Cancel
Save