aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2006-02-20 17:50:36 +0000
committerWayne Davison <wayned@samba.org>2006-02-20 17:50:36 +0000
commit9a0cfff57f6598a2f8ede199ef31be4dc57a8dad (patch)
treed92aede759eade8757835172942a35b770a0dc7e /io.c
parentd749eb6896029099c08cda39e738a87468f76ffc (diff)
downloadandroid_external_rsync-9a0cfff57f6598a2f8ede199ef31be4dc57a8dad.tar.gz
android_external_rsync-9a0cfff57f6598a2f8ede199ef31be4dc57a8dad.tar.bz2
android_external_rsync-9a0cfff57f6598a2f8ede199ef31be4dc57a8dad.zip
Don't try to obey bwlimit restriction until bwlimit_writemax is set.
This fixes a bug with option errors not getting reported because the write code gets called with bwlimit != 0 and bwlimit_writemax == 0.
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index 0948416f..b69ae00b 100644
--- a/io.c
+++ b/io.c
@@ -1011,7 +1011,7 @@ static void sleep_for_bwlimit(int bytes_written)
#define ONE_SEC 1000000L /* # of microseconds in a second */
- if (!bwlimit)
+ if (!bwlimit_writemax)
return;
total_written += bytes_written;
@@ -1091,7 +1091,7 @@ static void writefd_unbuffered(int fd,char *buf,size_t len)
continue;
n = len - total;
- if (bwlimit && n > bwlimit_writemax)
+ if (bwlimit_writemax && n > bwlimit_writemax)
n = bwlimit_writemax;
cnt = write(fd, buf + total, n);