Browse Source

If we're not checking the errno on failed select we should not be looping in wait_read/write select

master
Con Kolivas 10 years ago
parent
commit
1edcd9ed6c
  1. 12
      src/libckpool.c

12
src/libckpool.c

@ -610,17 +610,13 @@ int wait_read_select(int sockd, int timeout)
{ {
tv_t tv_timeout; tv_t tv_timeout;
fd_set readfs; fd_set readfs;
int ret;
tv_timeout.tv_sec = timeout; tv_timeout.tv_sec = timeout;
tv_timeout.tv_usec = 0; tv_timeout.tv_usec = 0;
FD_ZERO(&readfs); FD_ZERO(&readfs);
FD_SET(sockd, &readfs); FD_SET(sockd, &readfs);
do { return select(sockd + 1, &readfs, NULL, NULL, &tv_timeout);
ret = select(sockd + 1, &readfs, NULL, NULL, &tv_timeout);
} while (unlikely(ret < 0));
return ret;
} }
int read_length(int sockd, void *buf, int len) int read_length(int sockd, void *buf, int len)
@ -688,17 +684,13 @@ int wait_write_select(int sockd, int timeout)
{ {
tv_t tv_timeout; tv_t tv_timeout;
fd_set writefds; fd_set writefds;
int ret;
tv_timeout.tv_sec = timeout; tv_timeout.tv_sec = timeout;
tv_timeout.tv_usec = 0; tv_timeout.tv_usec = 0;
FD_ZERO(&writefds); FD_ZERO(&writefds);
FD_SET(sockd, &writefds); FD_SET(sockd, &writefds);
do { return select(sockd + 1, NULL, &writefds, NULL, &tv_timeout);
ret = select(sockd + 1, NULL, &writefds, NULL, &tv_timeout);
} while (unlikely(ret < 0));
return ret;
} }
int write_length(int sockd, const void *buf, int len) int write_length(int sockd, const void *buf, int len)

Loading…
Cancel
Save