diff options
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -71,7 +71,7 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #include "includes.h" | 73 | #include "includes.h" |
74 | RCSID("$OpenBSD: scp.c,v 1.114 2004/04/01 12:19:57 markus Exp $"); | 74 | RCSID("$OpenBSD: scp.c,v 1.115 2004/06/21 17:36:31 avsm Exp $"); |
75 | 75 | ||
76 | #include "xmalloc.h" | 76 | #include "xmalloc.h" |
77 | #include "atomicio.h" | 77 | #include "atomicio.h" |
@@ -663,7 +663,7 @@ bwlimit(int amount) | |||
663 | { | 663 | { |
664 | static struct timeval bwstart, bwend; | 664 | static struct timeval bwstart, bwend; |
665 | static int lamt, thresh = 16384; | 665 | static int lamt, thresh = 16384; |
666 | u_int64_t wait; | 666 | u_int64_t waitlen; |
667 | struct timespec ts, rm; | 667 | struct timespec ts, rm; |
668 | 668 | ||
669 | if (!timerisset(&bwstart)) { | 669 | if (!timerisset(&bwstart)) { |
@@ -681,10 +681,10 @@ bwlimit(int amount) | |||
681 | return; | 681 | return; |
682 | 682 | ||
683 | lamt *= 8; | 683 | lamt *= 8; |
684 | wait = (double)1000000L * lamt / limit_rate; | 684 | waitlen = (double)1000000L * lamt / limit_rate; |
685 | 685 | ||
686 | bwstart.tv_sec = wait / 1000000L; | 686 | bwstart.tv_sec = waitlen / 1000000L; |
687 | bwstart.tv_usec = wait % 1000000L; | 687 | bwstart.tv_usec = waitlen % 1000000L; |
688 | 688 | ||
689 | if (timercmp(&bwstart, &bwend, >)) { | 689 | if (timercmp(&bwstart, &bwend, >)) { |
690 | timersub(&bwstart, &bwend, &bwend); | 690 | timersub(&bwstart, &bwend, &bwend); |