components/ntp/patches/70-leapslew.patch
changeset 5360 af56e129673d
parent 5359 57359db17e2a
child 5361 7e2f2fc264b8
--- a/components/ntp/patches/70-leapslew.patch	Thu Jan 28 10:36:09 2016 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-This patch can be removed when upgrading to community version that has
-NTP bug 2745 fixed. See http://bugzilla.ntp.org/show_bug.cgi?id=2745
-
---- ntpd/ntp_timer.c
-+++ ntpd/ntp_timer.c
-@@ -472,7 +472,7 @@ alarming(
- # endif
- # ifdef DEBUG
- 	if (debug >= 4)
--		write(1, msg, strlen(msg));
-+		(void)(0 != write(1, msg, strlen(msg)));
- # endif
- }
- #endif /* SYS_WINNT */
-@@ -521,11 +521,23 @@ check_leapsec(
- 		 * announce the leap event has happened.
- 		 */
- 		if (lsdata.warped < 0) {
--			step_systime(lsdata.warped);
--			msyslog(LOG_NOTICE, "Inserting positive leap second.");
-+			if (clock_max_back > 0.0 &&
-+			    clock_max_back < fabs(lsdata.warped)) {
-+				step_systime(lsdata.warped);
-+				msyslog(LOG_NOTICE, "Positive leap second, stepped backward.");
-+			} else {
-+				msyslog(LOG_NOTICE, "Positive leap second, expect slowdown slew soon."
-+				    " System clock will be inaccurate until it finishes.");
-+			}
- 		} else 	if (lsdata.warped > 0) {
--			step_systime(lsdata.warped);
--			msyslog(LOG_NOTICE, "Inserting negative leap second.");
-+			if (clock_max_fwd > 0.0 &&
-+			    clock_max_fwd < fabs(lsdata.warped)) {
-+				step_systime(lsdata.warped);
-+				msyslog(LOG_NOTICE, "Negative leap second, stepped forward.");
-+			} else {
-+				msyslog(LOG_NOTICE, "Negative leap second, expect speedup slew soon."
-+				    " System clock will be inaccurate until it finishes.");
-+			}
- 		}
- 		report_event(EVNT_LEAP, NULL, NULL);
- 		lsprox  = LSPROX_NOWARN;