util: return normalised timevals
This commit is contained in:
parent
71e0ebcb6b
commit
0899ab52dd
1 changed files with 4 additions and 0 deletions
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
Loading…
Reference in a new issue