[Git][NTPsec/ntpsec][master] Steps towards resolving GitLab issue #34: osx: build warnings with lockclock

Eric S. Raymond gitlab at mg.gitlab.com
Tue Oct 4 03:44:39 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
c13613d3 by Eric S. Raymond at 2016-10-03T23:43:20-04:00
Steps towards resolving GitLab issue #34: osx: build warnings with lockclock

Not yet a complete fix.

- - - - -


2 changed files:

- ntpd/ntp_loopfilter.c
- ntpd/refclock_local.c


Changes:

=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -442,6 +442,10 @@ local_clock(
 	double	fp_offset	/* clock offset (s) */
 	)
 {
+#ifdef ENABLE_LOCKCLOCK
+	UNUSED_ARG(peer);
+	UNUSED_ARG(fp_offset);
+#else
 	int	rval;		/* return code */
 	int	osys_poll;	/* old system poll */
 #ifdef HAVE_KERNEL_PLL
@@ -451,6 +455,7 @@ local_clock(
 	double	clock_frequency; /* clock frequency */
 	double	dtemp, etemp;	/* double temps */
 	char	tbuf[80];	/* report buffer */
+#endif /* ENABLE_LOCKCLOCK */
 
 	/*
 	 * If the loop is opened or the NIST lockclock scheme is in use,
@@ -940,9 +945,11 @@ adj_host_clock(
 	void
 	)
 {
+#ifndef ENABLE_LOCKCLOCK
 	double	offset_adj;
 	double	freq_adj;
-
+#endif /* ENABLE_LOCKCLOCK */
+	
 	/*
 	 * Update the dispersion since the last update. In contrast to
 	 * NTPv3, NTPv4 does not declare unsynchronized after one day,
@@ -1235,7 +1242,6 @@ loop_config(
 	)
 {
 	int	i;
-	double	ftemp;
 
 #ifdef DEBUG
 	if (debug > 1)
@@ -1261,12 +1267,14 @@ loop_config(
 		 * Initialize frequency if given; otherwise, begin frequency
 		 * calibration phase.
 		 */
-		ftemp = init_drift_comp / 1e6;
-		if (ftemp > NTP_MAXFREQ)
-			ftemp = NTP_MAXFREQ;
-		else if (ftemp < -NTP_MAXFREQ)
-			ftemp = -NTP_MAXFREQ;
-		set_freq(ftemp);
+		{
+			double ftemp = init_drift_comp / 1e6;
+			if (ftemp > NTP_MAXFREQ)
+				ftemp = NTP_MAXFREQ;
+			else if (ftemp < -NTP_MAXFREQ)
+				ftemp = -NTP_MAXFREQ;
+			set_freq(ftemp);
+		}
 		if (freq_set)
 			rstclock(EVNT_FSET, 0);
 		else


=====================================
ntpd/refclock_local.c
=====================================
--- a/ntpd/refclock_local.c
+++ b/ntpd/refclock_local.c
@@ -172,7 +172,7 @@ local_poll(
 	 */
 #if defined(HAVE_KERNEL_PLL) && defined(ENABLE_LOCKCLOCK)
 	memset(&ntv,  0, sizeof ntv);
-	switch (intercept_kernel_pll_adjtime(&ntv)) {
+	switch (adjtimex(&ntv)) {
 	case TIME_OK:
 		pp->leap = LEAP_NOWARNING;
 		peer->stratum = pp->stratum;



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/c13613d32b92e602bb8977e7773e301f53bdcb47
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161004/85b4379e/attachment.html>


More information about the vc mailing list