Index: io.c =================================================================== --- io.c (revision 1654) +++ io.c (working copy) @@ -643,13 +643,21 @@ int read_filesfrom_line(int fd, char *fn if (cnt < 0 && (errno == EWOULDBLOCK || errno == EINTR || errno == EAGAIN)) { struct timeval tv; - fd_set fds; + fd_set fds, e_fds;; FD_ZERO(&fds); FD_SET(fd, &fds); + FD_ZERO(&e_fds); + FD_SET(fd, &e_fds); tv.tv_sec = select_timeout; tv.tv_usec = 0; - if (!select(fd+1, &fds, NULL, NULL, &tv)) + if (!select(fd+1, &fds, NULL, &e_fds, &tv)) check_timeout(); + if (FD_ISSET(fd, &e_fds)) { + rprintf(FINFO, "select error: exception " + "fd = %d, errno = %d\n", + fd, errno); + } + continue; } if (cnt != 1) @@ -1046,7 +1054,7 @@ static void sleep_for_bwlimit(int bytes_ static void writefd_unbuffered(int fd,char *buf,size_t len) { size_t n, total = 0; - fd_set w_fds, r_fds; + fd_set w_fds, r_fds, e_fds; int maxfd, count, cnt, using_r_fds; int defer_save = defer_forwarding_messages; struct timeval tv; @@ -1056,6 +1064,8 @@ static void writefd_unbuffered(int fd,ch while (total < len) { FD_ZERO(&w_fds); FD_SET(fd,&w_fds); + FD_ZERO(&e_fds); + FD_SET(fd,&e_fds); maxfd = fd; if (msg_fd_in >= 0) { @@ -1072,7 +1082,13 @@ static void writefd_unbuffered(int fd,ch errno = 0; count = select(maxfd + 1, using_r_fds ? &r_fds : NULL, - &w_fds, NULL, &tv); + &w_fds, &e_fds, &tv); + + if (FD_ISSET(fd, &e_fds)) { + rprintf(FINFO, "select error: exception fd = %d, " + "errno = %d\n", + fd, errno); + } if (count <= 0) { if (count < 0 && errno == EBADF)