mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-21 21:34:17 -04:00
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.
This commit is contained in:
1 parent
d749eb6896
commit
9a0cfff57f
1 file changed
+2
-2
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user