int count;
FD_ZERO(&r_fds);
+ FD_ZERO(&w_fds);
FD_SET(fd, &r_fds);
if (msg_fd_in >= 0) {
FD_SET(msg_fd_in, &r_fds);
new_fd = -1;
}
} else {
- FD_ZERO(&w_fds);
FD_SET(io_filesfrom_f_out, &w_fds);
new_fd = io_filesfrom_f_out;
}
errno = 0;
- count = select(maxfd + 1, &r_fds,
- io_filesfrom_buflen? &w_fds : NULL,
- NULL, &tv);
+ count = select(maxfd + 1, &r_fds, &w_fds, NULL, &tv);
if (count <= 0) {
- check_timeout();
if (errno == EBADF)
exit_cleanup(RERR_SOCKETIO);
+ check_timeout();
continue;
}
&w_fds, NULL, &tv);
if (count <= 0) {
- check_timeout();
if (count < 0 && errno == EBADF)
exit_cleanup(RERR_SOCKETIO);
+ check_timeout();
continue;
}