]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 508] Fixed leap second handling for Windows.
authorMartin Burnicki <burnicki@ntp.org>
Mon, 7 Dec 2009 10:58:19 +0000 (11:58 +0100)
committerMartin Burnicki <burnicki@ntp.org>
Mon, 7 Dec 2009 10:58:19 +0000 (11:58 +0100)
bk: 4b1cdfcbxFRAwrJve1BjnvU7l0vE7w

ChangeLog
ntpd/ntp_timer.c
ports/winnt/ntpd/nt_clockstuff.c

index e24fe217757497de477e1341d61dd023be71f04b..b7b5aab09e23690d6579b822690680276a619200 100644 (file)
--- 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 <stenn@ntp.org>
 * sntp documentation updates.
 * [Bug 761] internal resolver does not seem to honor -4/-6 qualifiers
index dd178a557a0a03ef1395dfcce830b87014717d72..d5a1206d06a24218df4b85ba1b9c16f521763132 100644 (file)
@@ -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 {
index 85d286bcf9f212fd1039791d82e6e73dd00fc62f..b0e298e4b8c89d213a2d14d0fc41c0fa4886226a 100644 (file)
@@ -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