X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/bd717af8ab588cd9d05825ff8adfbe5dc91049ca..a04d77bcbcabb93fbd893ae472d7b5d901b16da4:/io.c diff --git a/io.c b/io.c index ef4735c4..421571a5 100644 --- a/io.c +++ b/io.c @@ -380,6 +380,7 @@ static int read_timeout(int fd, char *buf, size_t len) 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); @@ -401,7 +402,6 @@ static int read_timeout(int fd, char *buf, size_t len) new_fd = -1; } } else { - FD_ZERO(&w_fds); FD_SET(io_filesfrom_f_out, &w_fds); new_fd = io_filesfrom_f_out; } @@ -414,9 +414,7 @@ static int read_timeout(int fd, char *buf, size_t len) 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) { if (errno == EBADF)