mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
leapdb: support leap-seconds.list as second source
The existing implementation of getting leap second information from a timezone in get_tz_leap() relies on non-portable C library behaviour. Specifically, mktime is not required to return '60' in the tm_sec field when a leap second is inserted leading to "Timezone right/UTC failed leap second check, ignoring" errors on musl based systems. This patch adds support for getting leap second information from the leap-seconds.list file included with tzdata and adds a new configuration directive leapseclist to switch on the feature.
This commit is contained in:
committed by
Miroslav Lichvar
parent
83f90279b0
commit
53823b9f1c
@@ -166,8 +166,8 @@ RCL_AddRefclock(RefclockParameters *params)
|
||||
if (!inst->driver->init && !inst->driver->poll)
|
||||
LOG_FATAL("refclock driver %s is not compiled in", params->driver_name);
|
||||
|
||||
if (params->tai && !CNF_GetLeapSecTimezone())
|
||||
LOG_FATAL("refclock tai option requires leapsectz");
|
||||
if (params->tai && !CNF_GetLeapSecList() && !CNF_GetLeapSecTimezone())
|
||||
LOG_FATAL("refclock tai option requires leapseclist or leapsectz");
|
||||
|
||||
inst->data = NULL;
|
||||
inst->driver_parameter = Strdup(params->driver_parameter);
|
||||
|
||||
Reference in New Issue
Block a user