From: Harlan Stenn Date: Wed, 5 Sep 2012 10:33:07 +0000 (-0400) Subject: [Bug 2160] Log warning about expired leapseconds file X-Git-Tag: NTP_4_2_7P302~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27af02b3154c1eb74d61455ba528d41a84aa0b29;p=thirdparty%2Fntp.git [Bug 2160] Log warning about expired leapseconds file bk: 50472a63CpiY3iuheZUEE84wWArE2g --- diff --git a/ChangeLog b/ChangeLog index 5750e5d00..1d7b62d23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 2160] Log warning about expired leapseconds file. (4.2.7p301) 2012/09/03 Released by Harlan Stenn * [Bug 2164] Greater precision needed for ntpq offset report. * Clean the man5_MANS in ntpd/ . diff --git a/ntpd/ntp_timer.c b/ntpd/ntp_timer.c index c853aac9a..974f5ddd9 100644 --- a/ntpd/ntp_timer.c +++ b/ntpd/ntp_timer.c @@ -279,6 +279,7 @@ timer(void) struct peer * p; struct peer * next_peer; l_fp now; + static int leap_warn_log = FALSE; /* * The basic timerevent is one second. This is used to adjust the @@ -427,8 +428,15 @@ timer(void) write_stats(); if (sys_tai != 0) { get_systime(&now); - if (now.l_ui > leap_expire) + if (now.l_ui > leap_expire) { report_event(EVNT_LEAPVAL, NULL, NULL); + if (leap_warn_log == FALSE) { + msyslog(LOG_WARNING, + "leapseconds data file has expired."); + leap_warn_log = TRUE; + } + } else + leap_warn_log = FALSE; } } }