mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-06 08:45:07 -05:00
sys: add new log message for kernel status reset after leap second
When a leap second is applied by the kernel, it doesn't actually clear the STA_INS|STA_DEL bits from the status word, but the state returned by ntp_adjtime()/adjtimex() is TIME_WAIT until the application clears the bits. Add "System clock status reset after leap second" log message for this case.
This commit is contained in:
@@ -177,9 +177,9 @@ read_frequency(void)
|
||||
static void
|
||||
set_leap(int leap)
|
||||
{
|
||||
int current_leap;
|
||||
int current_leap, applied;
|
||||
|
||||
if (TMX_GetLeap(¤t_leap) < 0) {
|
||||
if (TMX_GetLeap(¤t_leap, &applied) < 0) {
|
||||
LOG_FATAL(LOGF_SysLinux, "adjtimex() failed in set_leap");
|
||||
}
|
||||
|
||||
@@ -190,8 +190,9 @@ set_leap(int leap)
|
||||
LOG_FATAL(LOGF_SysLinux, "adjtimex() failed in set_leap");
|
||||
}
|
||||
|
||||
LOG(LOGS_INFO, LOGF_SysLinux, "System clock status set to %s leap second",
|
||||
leap ? (leap > 0 ? "insert" : "delete") : "not insert/delete");
|
||||
LOG(LOGS_INFO, LOGF_SysLinux, "System clock status %s leap second",
|
||||
leap ? (leap > 0 ? "set to insert" : "set to delete") :
|
||||
(applied ? "reset after" : "set to not insert/delete"));
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
Reference in New Issue
Block a user