mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 00:15:07 -05:00
util: return normalised timevals
This commit is contained in:
4
util.c
4
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 */
|
/* 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);
|
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
|
#else
|
||||||
dest->tv_sec = sec_low;
|
dest->tv_sec = sec_low;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
UTI_NormaliseTimeval(dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|||||||
Reference in New Issue
Block a user