git.samba.org
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a05758f
)
Fix bwlimit multiplication overflow. Fixes bug 8375.
author
Wayne Davison
<wayned@samba.org>
Sat, 27 Aug 2011 17:28:20 +0000
(10:28 -0700)
committer
Wayne Davison
<wayned@samba.org>
Sat, 27 Aug 2011 19:05:07 +0000
(12:05 -0700)
io.c
patch
|
blob
|
history
diff --git
a/io.c
b/io.c
index 4fb78aab77fa060b4b9c81567089ac22f5540724..7cb3be137c8c8862c9694075df13940004dd19a8 100644
(file)
--- a/
io.c
+++ b/
io.c
@@
-1936,7
+1936,7
@@
static void sleep_for_bwlimit(int bytes_written)
if (prior_tv.tv_sec) {
elapsed_usec = (start_tv.tv_sec - prior_tv.tv_sec) * ONE_SEC
+ (start_tv.tv_usec - prior_tv.tv_usec);
- total_written -= elapsed_usec * bwlimit / (ONE_SEC/1024);
+ total_written -=
(int64)
elapsed_usec * bwlimit / (ONE_SEC/1024);
if (total_written < 0)
total_written = 0;
}