mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:35:06 -05:00
reference: improve check for close leap second
Improve the check to work with the actual timestamp of the leap second instead of the closest midnight and don't turn it off on the leap timeout. Also allow sample times to be checked in addition to the system time and NTP time to avoid accumulation of samples mixing pre-leap and post-leap timestamps (causing error of +/-0.5 or +/-1.0 seconds).
This commit is contained in:
@@ -184,9 +184,9 @@ extern void REF_ModifyMakestep(int limit, double threshold);
|
||||
extern void REF_EnableLocal(int stratum, double distance, int orphan);
|
||||
extern void REF_DisableLocal(void);
|
||||
|
||||
/* Check if current raw or cooked time is close to a leap second
|
||||
and is better to discard any measurements */
|
||||
extern int REF_IsLeapSecondClose(void);
|
||||
/* Check if either of the current raw and cooked time, and optionally a
|
||||
provided timestamp with an offset, is close to a leap second */
|
||||
extern int REF_IsLeapSecondClose(struct timespec *ts, double offset);
|
||||
|
||||
/* Return TAI-UTC offset corresponding to a time in UTC if available */
|
||||
extern int REF_GetTaiOffset(struct timespec *ts);
|
||||
|
||||
Reference in New Issue
Block a user