From: Miroslav Lichvar Date: Wed, 17 Aug 2016 10:13:35 +0000 (+0200) Subject: util: return normalised timevals X-Git-Tag: 3.0-pre1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0899ab52ddeb98d447cd3144790391c9e2e7941d;p=thirdparty%2Fchrony.git util: return normalised timevals --- diff --git a/util.c b/util.c index 895fbe02..4b473844 100644 --- a/util.c +++ b/util.c @@ -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); } /* ================================================== */