X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/1f5c6343e6a3d55689073f60e71fd56cab42f89d..07b7c86c0672c38648fb715efbc0bfffd81ed182:/io.c diff --git a/io.c b/io.c index 9e2d3790..9e2a4757 100644 --- a/io.c +++ b/io.c @@ -361,8 +361,11 @@ static void writefd_unbuffered(int fd,char *buf,int len) } if (FD_ISSET(fd, &w_fds)) { - int n = len-total; - int ret = write(fd,buf+total,n?n:1); + int ret, n = len-total; + + if (n > PIPE_BUF) n = PIPE_BUF; + + ret = write(fd,buf+total,n?n:1); if (ret == -1 && errno == EINTR) { continue;