From: Martin Burnicki Date: Mon, 7 Dec 2009 10:58:19 +0000 (+0100) Subject: [Bug 508] Fixed leap second handling for Windows. X-Git-Tag: NTP_4_2_6_RC~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c6b53c38b1b8591ff9a92bbad47d9fd7303ea21d;p=thirdparty%2Fntp.git [Bug 508] Fixed leap second handling for Windows. bk: 4b1cdfcbxFRAwrJve1BjnvU7l0vE7w --- diff --git a/ChangeLog b/ChangeLog index e24fe2177..b7b5aab09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,4 @@ +* [Bug 508] Fixed leap second handling for Windows. (4.2.5p250-RC) 2009/11/30 Released by Harlan Stenn * sntp documentation updates. * [Bug 761] internal resolver does not seem to honor -4/-6 qualifiers diff --git a/ntpd/ntp_timer.c b/ntpd/ntp_timer.c index dd178a557..d5a1206d0 100644 --- a/ntpd/ntp_timer.c +++ b/ntpd/ntp_timer.c @@ -341,7 +341,9 @@ timer(void) if (!(pll_control && kern_enable)) step_systime(-1.0); #else /* KERNEL_PLL */ +#ifndef SYS_WINNT /* WinNT port has its own leap second handling */ step_systime(-1.0); +#endif /* SYS_WINNT */ #endif /* KERNEL_PLL */ report_event(EVNT_LEAP, NULL, NULL); } else { diff --git a/ports/winnt/ntpd/nt_clockstuff.c b/ports/winnt/ntpd/nt_clockstuff.c index 85d286bcf..b0e298e4b 100644 --- a/ports/winnt/ntpd/nt_clockstuff.c +++ b/ports/winnt/ntpd/nt_clockstuff.c @@ -419,7 +419,7 @@ adj_systime( * If a leap second is pending then determine the UTC time stamp * of when the insertion must take place */ - if (leap_sec > 0) + if (leapsec > 0) { if ( ls_ft.ull == 0 ) /* time stamp has not yet been computed */ { @@ -458,8 +458,23 @@ adj_systime( } } } + else + { + if ( ls_ft.ull ) /* Leap second has been armed before */ + { + /* + * Disarm leap second only if the leap second + * is not already in progress. + */ + if ( !ls_time_adjustment ) + { + ls_ft.ull = 0; + msyslog( LOG_NOTICE, "Leap second announcement disarmed" ); + } + } + } + - /* * If the time stamp for the next leap second has been set * then check if the leap second must be handled