]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
util: return normalised timevals
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 17 Aug 2016 10:13:35 +0000 (12:13 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 19 Aug 2016 09:33:38 +0000 (11:33 +0200)
util.c

diff --git a/util.c b/util.c
index 895fbe023ad0f83b0b5f0bf4e4cf7747bc6b9adf..4b4738447e13b83762a00e5065ea098d0f1f0981 100644 (file)
--- 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);
 }
 
 /* ================================================== */