mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-11 04:17:42 +02:00
- Fix to timeval_add for remaining second in microseconds.
This commit is contained in:
+1
-1
@@ -174,7 +174,7 @@ dl_tv_add(struct timeval* t1, const struct timeval* t2)
|
||||
#ifndef S_SPLINT_S
|
||||
t1->tv_sec += t2->tv_sec;
|
||||
t1->tv_usec += t2->tv_usec;
|
||||
while(t1->tv_usec > 1000000) {
|
||||
while(t1->tv_usec >= 1000000) {
|
||||
t1->tv_usec -= 1000000;
|
||||
t1->tv_sec++;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ timeval_add(struct timeval* d, const struct timeval* add)
|
||||
#ifndef S_SPLINT_S
|
||||
d->tv_sec += add->tv_sec;
|
||||
d->tv_usec += add->tv_usec;
|
||||
if(d->tv_usec > 1000000) {
|
||||
if(d->tv_usec >= 1000000) {
|
||||
d->tv_usec -= 1000000;
|
||||
d->tv_sec++;
|
||||
}
|
||||
|
||||
+1
-1
@@ -177,7 +177,7 @@ perf_tv_add(struct timeval* t1, struct timeval* t2)
|
||||
#ifndef S_SPLINT_S
|
||||
t1->tv_sec += t2->tv_sec;
|
||||
t1->tv_usec += t2->tv_usec;
|
||||
while(t1->tv_usec > 1000000) {
|
||||
while(t1->tv_usec >= 1000000) {
|
||||
t1->tv_usec -= 1000000;
|
||||
t1->tv_sec++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user