mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 13:05:08 -05:00
Drop duplicated int64_to_timeval()
This commit is contained in:
15
util.c
15
util.c
@@ -210,19 +210,6 @@ UTI_TimevalToString(struct timeval *tv)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================== */
|
|
||||||
#define JAN_1970 0x83aa7e80UL
|
|
||||||
|
|
||||||
inline static void
|
|
||||||
int64_to_timeval(NTP_int64 *src,
|
|
||||||
struct timeval *dest)
|
|
||||||
{
|
|
||||||
dest->tv_sec = ntohl(src->hi) - JAN_1970;
|
|
||||||
|
|
||||||
/* Until I invent a slick way to do this, just do it the obvious way */
|
|
||||||
dest->tv_usec = (int)(0.5 + (double)(ntohl(src->lo)) / 4294.967296);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
/* Convert an NTP timestamp into a temporary string, largely
|
/* Convert an NTP timestamp into a temporary string, largely
|
||||||
for diagnostic display */
|
for diagnostic display */
|
||||||
@@ -231,7 +218,7 @@ char *
|
|||||||
UTI_TimestampToString(NTP_int64 *ts)
|
UTI_TimestampToString(NTP_int64 *ts)
|
||||||
{
|
{
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
int64_to_timeval(ts, &tv);
|
UTI_Int64ToTimeval(ts, &tv);
|
||||||
return UTI_TimevalToString(&tv);
|
return UTI_TimevalToString(&tv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user