diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-11-25 19:15:28 +0000 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-11-25 19:15:28 +0000 |
commit | 356da57dbd882a2e9a380c4d8b60f132f41cc593 (patch) | |
tree | 4ad06a26bea1e80ba292f516da3afb34478d5af6 /src/lib | |
parent | aee22e3b33e3e051cbc0f99ca033faf5fac22990 (diff) | |
parent | bf596a9abd6dc05b0d15e8401d267696632350a4 (diff) | |
download | ouroboros-356da57dbd882a2e9a380c4d8b60f132f41cc593.tar.gz ouroboros-356da57dbd882a2e9a380c4d8b60f132f41cc593.zip |
Merged in dstaesse/ouroboros/be-timerwheel (pull request #309)
ipcpd, lib: Fix timerwheel issues / time_utils
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/time_utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/time_utils.c b/src/lib/time_utils.c index b34e4763..4da935c4 100644 --- a/src/lib/time_utils.c +++ b/src/lib/time_utils.c @@ -39,7 +39,7 @@ int ts_add(const struct timespec * t, nanos = t->tv_nsec + intv->tv_nsec; res->tv_sec = t->tv_sec + intv->tv_sec; - while (nanos > BILLION) { + while (nanos >= BILLION) { nanos -= BILLION; ++(res->tv_sec); } @@ -85,7 +85,7 @@ int tv_add(const struct timeval * t, micros = t->tv_usec + intv->tv_usec; res->tv_sec = t->tv_sec + intv->tv_sec; - while (micros > MILLION) { + while (micros >= MILLION) { micros -= MILLION; --(res->tv_sec); } |