mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 03:45:07 -05:00
reference: use step leap mode by default if system is not supported
This commit is contained in:
8
local.c
8
local.c
@@ -612,6 +612,14 @@ LCL_MakeStep(void)
|
|||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
|
|
||||||
|
int
|
||||||
|
LCL_CanSystemLeap(void)
|
||||||
|
{
|
||||||
|
return drv_set_leap ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ================================================== */
|
||||||
|
|
||||||
void
|
void
|
||||||
LCL_SetSystemLeap(int leap)
|
LCL_SetSystemLeap(int leap)
|
||||||
{
|
{
|
||||||
|
|||||||
4
local.h
4
local.h
@@ -198,6 +198,10 @@ extern void LCL_Finalise(void);
|
|||||||
to a timezone problem. */
|
to a timezone problem. */
|
||||||
extern int LCL_MakeStep(void);
|
extern int LCL_MakeStep(void);
|
||||||
|
|
||||||
|
/* Check if the system driver supports leap seconds, i.e. LCL_SetSystemLeap
|
||||||
|
does something */
|
||||||
|
extern int LCL_CanSystemLeap(void);
|
||||||
|
|
||||||
/* Routine to set the system clock to correct itself for a leap second if
|
/* Routine to set the system clock to correct itself for a leap second if
|
||||||
supported. Leap second will be inserted at the end of the day if the
|
supported. Leap second will be inserted at the end of the day if the
|
||||||
argument is positive, deleted if negative, and zero resets the setting. */
|
argument is positive, deleted if negative, and zero resets the setting. */
|
||||||
|
|||||||
@@ -240,6 +240,9 @@ REF_Initialise(void)
|
|||||||
leap_timer_running = 0;
|
leap_timer_running = 0;
|
||||||
leap_in_progress = 0;
|
leap_in_progress = 0;
|
||||||
leap_mode = CNF_GetLeapSecMode();
|
leap_mode = CNF_GetLeapSecMode();
|
||||||
|
/* Switch to step mode if the system driver doesn't support leap */
|
||||||
|
if (leap_mode == REF_LeapModeSystem && !LCL_CanSystemLeap())
|
||||||
|
leap_mode = REF_LeapModeStep;
|
||||||
|
|
||||||
leap_tzname = CNF_GetLeapSecTimezone();
|
leap_tzname = CNF_GetLeapSecTimezone();
|
||||||
if (leap_tzname) {
|
if (leap_tzname) {
|
||||||
|
|||||||
Reference in New Issue
Block a user