]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 2326] More leapsecond file notification cleanup
authorHarlan Stenn <stenn@ntp.org>
Sat, 23 Nov 2013 22:08:57 +0000 (14:08 -0800)
committerHarlan Stenn <stenn@ntp.org>
Sat, 23 Nov 2013 22:08:57 +0000 (14:08 -0800)
bk: 52912779gMNTeEaXV_DVhQTawqp1dA

ChangeLog
ntpd/ntp_io.c
ntpd/ntp_timer.c

index cd6608d2599ec76372b22c26f84531eb3ba75f4b..54f3688c4812f95aa23a8c0f9e5600dd3f4df13e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,5 @@
+* [Bug 2326] More leapsecond file notification cleanup.
+* Improve sntp KoD data file fopen() error message.
 (4.2.7p397) 2013/11/20 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 2326] More leapsecond file notification cleanup.
 (4.2.7p396) 2013/11/19 Released by Harlan Stenn <stenn@ntp.org>
index cd4d871cb3f4550d2b94a74659d815f8dcf736cc..fde2baf4389120522571b1ee84bf56d788e7a89c 100644 (file)
@@ -3717,7 +3717,7 @@ input_handler(
 #ifdef DEBUG
                if (debug)
                        msyslog(LOG_DEBUG, "input_handler: select() returned 0");
-#endif
+#endif /* DEBUG */
                goto ih_return;
        }
        /* We've done our work */
@@ -3734,22 +3734,39 @@ input_handler(
                msyslog(LOG_DEBUG,
                        "input_handler: Processed a gob of fd's in %s msec",
                        lfptoms(&ts_e, 6));
-#endif
+#endif /* DEBUG_TIMING */
        /* We're done... */
     ih_return:
        if (check_leapfile < time(NULL)) {
-               int rc;
+               int clf;
 
                check_leapfile += CHECK_LEAP_EVERY;
-               rc = check_leap_file();
+               clf = check_leap_file();
 
-               if (rc < 31)
-                       msyslog(LOG_DEBUG,
-                               "input_handler: check_leap_file() returned %d.' time!", rc);
+               /*
+               ** check_leap_file() returns -1 on a problem,
+               ** 0 on an expired leapsecond file, or the number
+               ** of days until the leapsecond file expires.
+               */
+               if (-1 == clf) {
+                       /* nothing to do */
+               } else if (0 == clf) {
+                       /* XXX: Do we want to report_event() here? */
+                       // report_event(EVNT_LEAPVAL, NULL, NULL);
+                       if (leap_warn_log == FALSE) {
+                               msyslog(LOG_WARNING,
+                                       "input_handler: leapseconds data file <%s> has expired!",
+                                       leapseconds_file);
+                               leap_warn_log = TRUE;
+                       }
+               } else if (clf < 31) {
+                       msyslog(LOG_WARNING,
+                               "input_handler: leapseconds data file <%s> will expire in less than %d days' time.", leapseconds_file, clf);
+               }
        }
        return;
 }
-#endif /* HAVE_IO_COMPLETION_PORT */
+#endif /* !HAVE_IO_COMPLETION_PORT */
 
 
 /*
index ee2575705571b669301ab87ad2f5e4371e1b5efd..129d75cd8b172fe91d0fc12f879eebb63b799c10 100644 (file)
@@ -436,12 +436,13 @@ timer(void)
                                report_event(EVNT_LEAPVAL, NULL, NULL);
                                if (leap_warn_log == FALSE) {
                                        msyslog(LOG_WARNING,
-                                               "timer: leapseconds data file has expired!");
+                                               "timer: leapseconds data file <%s> has expired!",
+                                               leapseconds_file);
                                        leap_warn_log = TRUE;
                                }
                        } else if (clf < 31) {
                                msyslog(LOG_WARNING,
-                                       "timer: leapseconds data file will expire in about %d days' time!", clf);
+                                       "timer: leapseconds data file <%s> will expire in less than %d days' time.", leapseconds_file, clf);
                        }
                } else
                        leap_warn_log = FALSE;