mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 23:25:06 -05:00
Test leap second timezone on start
This commit is contained in:
14
reference.c
14
reference.c
@@ -126,6 +126,10 @@ static double last_ref_update_interval;
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
|
static NTP_Leap get_tz_leap(time_t when);
|
||||||
|
|
||||||
|
/* ================================================== */
|
||||||
|
|
||||||
static void
|
static void
|
||||||
handle_slew(struct timeval *raw,
|
handle_slew(struct timeval *raw,
|
||||||
struct timeval *cooked,
|
struct timeval *cooked,
|
||||||
@@ -202,6 +206,16 @@ REF_Initialise(void)
|
|||||||
enable_local_stratum = CNF_AllowLocalReference(&local_stratum);
|
enable_local_stratum = CNF_AllowLocalReference(&local_stratum);
|
||||||
|
|
||||||
leap_tzname = CNF_GetLeapSecTimezone();
|
leap_tzname = CNF_GetLeapSecTimezone();
|
||||||
|
if (leap_tzname) {
|
||||||
|
/* Check that the timezone has good data for Jun 30 2008 and Dec 31 2008 */
|
||||||
|
if (get_tz_leap(1214784000) == LEAP_Normal &&
|
||||||
|
get_tz_leap(1230681600) == LEAP_InsertSecond) {
|
||||||
|
LOG(LOGS_INFO, LOGF_Reference, "Using %s timezone to obtain leap second data", leap_tzname);
|
||||||
|
} else {
|
||||||
|
LOG(LOGS_WARN, LOGF_Reference, "Timezone %s failed leap second check, ignoring", leap_tzname);
|
||||||
|
leap_tzname = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CNF_GetMakeStep(&make_step_limit, &make_step_threshold);
|
CNF_GetMakeStep(&make_step_limit, &make_step_threshold);
|
||||||
CNF_GetMaxChange(&max_offset_delay, &max_offset_ignore, &max_offset);
|
CNF_GetMaxChange(&max_offset_delay, &max_offset_ignore, &max_offset);
|
||||||
|
|||||||
Reference in New Issue
Block a user