util: return normalised timevals

This commit is contained in:
Miroslav Lichvar 2016-08-17 12:13:35 +02:00
parent 71e0ebcb6b
commit 0899ab52dd

4
util.c
View file

@ -709,6 +709,8 @@ UTI_Int64ToTimeval(NTP_int64 *src,
/* Until I invent a slick way to do this, just do it the obvious way */
dest->tv_usec = (int)(0.5 + (double)(ntp_frac) / 4294.967296);
UTI_NormaliseTimeval(dest);
}
/* ================================================== */
@ -785,6 +787,8 @@ UTI_TimevalNetworkToHost(Timeval *src, struct timeval *dest)
#else
dest->tv_sec = sec_low;
#endif
UTI_NormaliseTimeval(dest);
}
/* ================================================== */