Commit 35713b52 authored by Joanne Hugé's avatar Joanne Hugé

Fix mistake in add_ns utility function

parent 22d0fa77
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
void add_ns(struct timespec *t, uint64_t ns) { void add_ns(struct timespec *t, uint64_t ns) {
t->tv_nsec += ns; t->tv_nsec += ns;
if ((unsigned int)t->tv_nsec >= NSEC_PER_SEC) { while ((unsigned int)t->tv_nsec >= NSEC_PER_SEC) {
t->tv_sec += 1; t->tv_sec += 1;
t->tv_nsec -= NSEC_PER_SEC; t->tv_nsec -= NSEC_PER_SEC;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment