diff options
author | Jef Poskanzer <jef@mail.acme.com> | 2013-02-18 09:06:50 -0800 |
---|---|---|
committer | Jef Poskanzer <jef@mail.acme.com> | 2013-02-18 09:06:50 -0800 |
commit | 037c0c236741633b6dc4c61730f814cc92d27f55 (patch) | |
tree | 747621e7f00f20b7eaa254fca1dc3364beafa2af /src/timer.c | |
parent | ba55284d44e947429a72f8d6a5017353037604a0 (diff) | |
download | iperf3-037c0c236741633b6dc4c61730f814cc92d27f55.tar.gz |
Handle timers longer than 2147 seconds (2^31 microseconds).
Diffstat (limited to 'src/timer.c')
-rw-r--r-- | src/timer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timer.c b/src/timer.c index eb1e7ed..4552571 100644 --- a/src/timer.c +++ b/src/timer.c @@ -159,12 +159,12 @@ tmr_timeout( struct timeval* nowP ) /* Since the list is sorted, we only need to look at the first timer. */ if ( timers == NULL ) return NULL; - usecs = ( timers->time.tv_sec - now.tv_sec ) * 1000000L + + usecs = ( timers->time.tv_sec - now.tv_sec ) * 1000000LL + ( timers->time.tv_usec - now.tv_usec ); if ( usecs <= 0 ) usecs = 0; - timeout.tv_sec = usecs / 1000000L; - timeout.tv_usec = usecs % 1000000L; + timeout.tv_sec = usecs / 1000000LL; + timeout.tv_usec = usecs % 1000000LL; return &timeout; } |