[Git][NTPsec/ntpsec][master] Make sure NTP_API is defined before checking the value

Matt Selsky gitlab at mg.gitlab.com
Mon Jun 12 03:47:56 UTC 2017


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
1e6bb03e by Matt Selsky at 2017-06-11T23:42:42-04:00
Make sure NTP_API is defined before checking the value

Fixes warnings like:
../../ntpd/ntp_loopfilter.c:145:26: warning: "NTP_API" is not defined, evaluates to 0 [-Wundef]

Reported by swalker on #ntpsec

- - - - -


1 changed file:

- ntpd/ntp_loopfilter.c


Changes:

=====================================
ntpd/ntp_loopfilter.c
=====================================
--- a/ntpd/ntp_loopfilter.c
+++ b/ntpd/ntp_loopfilter.c
@@ -142,7 +142,7 @@ static char *this_file = NULL;
 static struct timex ntv;	/* ntp_adjtime() parameters */
 static int	pll_status;	/* last kernel status bits */
 #ifndef ENABLE_LOCKCLOCK
-#if defined(STA_NANO) && NTP_API == 4
+#if defined(STA_NANO) && defined(NTP_API) && NTP_API == 4
 static u_int loop_tai;		/* last TAI offset */
 #endif /* STA_NANO */
 #endif /* ENABLE_LOCKCLOCK */
@@ -838,7 +838,7 @@ local_clock(
 			clock_jitter = ntv.jitter * S_PER_NS;
 		}
 
-#if defined(STA_NANO) && NTP_API == 4
+#if defined(STA_NANO) && defined(NTP_API) && NTP_API == 4
 		/*
 		 * If the TAI changes, update the kernel TAI.
 		 */



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/1e6bb03ed4aece568b997770153bcaef264a0e27

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/1e6bb03ed4aece568b997770153bcaef264a0e27
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170612/f1f91f2c/attachment.html>


More information about the vc mailing list