fd_set fds;
struct timeval tv;
int fd_count = fd+1;
+ int count;
FD_ZERO(&fds);
FD_SET(fd, &fds);
errno = 0;
- if (select(fd_count, &fds, NULL, NULL, &tv) < 1) {
+ count = select(fd_count, &fds, NULL, NULL, &tv);
+
+ if (count == 0) {
+ check_timeout();
+ }
+
+ if (count <= 0) {
if (errno == EBADF) {
exit_cleanup(RERR_SOCKETIO);
}
- check_timeout();
continue;
}
&w_fds,NULL,
&tv);
+ if (count == 0) {
+ check_timeout();
+ }
+
if (count <= 0) {
if (errno == EBADF) {
exit_cleanup(RERR_SOCKETIO);
}
- check_timeout();
continue;
}