fixup spinning

git-svn-id: file:///svn/unbound/trunk@1919 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards 2009-11-23 12:12:59 +00:00
parent 44a28f4343
commit 039f276b0c
5 changed files with 9 additions and 7 deletions

View file

@ -106,9 +106,9 @@ timeval_subtract(struct timeval* d, const struct timeval* end,
const struct timeval* start)
{
#ifndef S_SPLINT_S
time_t end_usec = end->tv_usec;;
time_t end_usec = end->tv_usec;
d->tv_sec = end->tv_sec - start->tv_sec;
while(end_usec < start->tv_usec) {
if(end_usec < start->tv_usec) {
end_usec += 1000000;
d->tv_sec--;
}

View file

@ -58,7 +58,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;
while(d->tv_usec > 1000000 ) {
if(d->tv_usec > 1000000) {
d->tv_usec -= 1000000;
d->tv_sec++;
}

View file

@ -1,5 +1,7 @@
23 November 2009: Wouter
- Patch from David Hubbard for libunbound manual page.
- Fixup endless spinning in unbound-control stats reported by
Attila Nagy. Probably caused by clock reversal.
20 November 2009: Wouter
- contrib/split-itar.sh contributed by Tom Hendrikx.

View file

@ -61,9 +61,9 @@ static void
timeval_subtract(struct timeval* d, const struct timeval* end, const struct timeval* start)
{
#ifndef S_SPLINT_S
time_t end_usec = end->tv_usec;;
time_t end_usec = end->tv_usec;
d->tv_sec = end->tv_sec - start->tv_sec;
while(end_usec < start->tv_usec) {
if(end_usec < start->tv_usec) {
end_usec += 1000000;
d->tv_sec--;
}
@ -78,7 +78,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;
while(d->tv_usec > 1000000 ) {
if(d->tv_usec > 1000000 ) {
d->tv_usec -= 1000000;
d->tv_sec++;
}

View file

@ -71,7 +71,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;
while(d->tv_usec > 1000000 ) {
if(d->tv_usec > 1000000) {
d->tv_usec -= 1000000;
d->tv_sec++;
}