]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2160] Log warning about expired leapseconds file
authorHarlan Stenn <stenn@ntp.org>
Wed, 5 Sep 2012 10:33:07 +0000 (06:33 -0400)
committerHarlan Stenn <stenn@ntp.org>
Wed, 5 Sep 2012 10:33:07 +0000 (06:33 -0400)
bk: 50472a63CpiY3iuheZUEE84wWArE2g

ChangeLog
ntpd/ntp_timer.c

index 5750e5d00f1d0f023960951c77af09ab3df266c7..1d7b62d231e0cef6a28dd37cd9e9783d97d066e2 100644 (file)
--- 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 <stenn@ntp.org>
 * [Bug 2164] Greater precision needed for ntpq offset report.
 * Clean the man5_MANS in ntpd/ .
index c853aac9affbb62a5d068a02cd264f7ab138922a..974f5ddd93db1c5c1530e8c1412e6bbcd37350a1 100644 (file)
@@ -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;
                }
        }
 }