From: Harlan Stenn Date: Wed, 27 Nov 2013 22:07:41 +0000 (+0000) Subject: [Bug 2326] More leapsecond file notification cleanup X-Git-Tag: NTP_4_2_7P399~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe191ed410db14de6694075faa0b23c737166e14;p=thirdparty%2Fntp.git [Bug 2326] More leapsecond file notification cleanup bk: 52966d2dqQFlnfJ0fEb1Ky_TJQvVCg --- diff --git a/ChangeLog b/ChangeLog index 4bd79cbc1..ff3343aa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 2326] More leapsecond file notification cleanup. (4.2.7p398) 2013/11/25 Released by Harlan Stenn * [Bug 2326] More leapsecond file notification cleanup. * Improve sntp KoD data file fopen() error message. diff --git a/ntpd/ntp_timer.c b/ntpd/ntp_timer.c index 379a2391d..0d0fbbafc 100644 --- a/ntpd/ntp_timer.c +++ b/ntpd/ntp_timer.c @@ -40,7 +40,7 @@ #define TC_ERR (-1) #endif -extern char *leapseconds_file; /*name of the leapseconds file */ +extern char *leapseconds_file; /* name of the leapseconds file */ static void check_leapsec(u_int32, const time_t*, int/*BOOL*/); @@ -67,8 +67,7 @@ volatile int alarm_flag; static u_long interface_timer; /* interface update timer */ static u_long adjust_timer; /* second timer */ static u_long stats_timer; /* stats timer */ -time_t check_leapfile = 0; /* Report leapfile problems once/day */ -#define CHECK_LEAP_EVERY 86400 +static u_long check_leapfile; /* Report leapfile problems once/day */ static u_long huffpuff_timer; /* huff-n'-puff timer */ static u_long worker_idle_timer;/* next check for idle intres */ u_long leapsec; /* seconds to next leap (proximity class) */ @@ -191,6 +190,7 @@ init_timer(void) alarm_overflow = 0; adjust_timer = 1; stats_timer = HOUR; + check_leapfile = 0; huffpuff_timer = 0; interface_timer = 0; current_time = 0; @@ -437,7 +437,7 @@ timer(void) ** We only want to log stuff once/day. */ if (check_leapfile < current_time) { - check_leapfile += CHECK_LEAP_EVERY; + check_leapfile += DAY; if (-1 == clf) { /* nothing to do */ } else if (0 == clf) {