[Git][NTPsec/ntpsec][master] 2 commits: NTP_API should be defined by system headers, to indicate compatibility, not us.

Eric S. Raymond gitlab at mg.gitlab.com
Sat Dec 10 16:09:15 UTC 2016


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


Commits:
f58d6900 by Matt Selsky at 2016-12-09T23:40:01-05:00
NTP_API should be defined by system headers, to indicate compatibility, not us.

- - - - -
84aa4d3c by Matt Selsky at 2016-12-09T23:40:01-05:00
Test directly if struct ntptimeval has a tai member

...instead of checking for NTP_API symbol

Fixes GitLab issue #200

- - - - -


3 changed files:

- libntp/clockwork.c
- ntptime/ntptime.c
- wafhelpers/configure.py


Changes:

=====================================
libntp/clockwork.c
=====================================
--- a/libntp/clockwork.c
+++ b/libntp/clockwork.c
@@ -120,11 +120,9 @@ int ntp_gettime(struct ntptimeval *ntv)
 	ntv->time = tntx.time;
 	ntv->maxerror = tntx.maxerror;
 	ntv->esterror = tntx.esterror;
-#  ifdef NTP_API
-#   if NTP_API > 3
+#if defined(STRUCT_NTPTIMEVAL_HAS_TAI)
 	ntv->tai = tntx.tai;
-#   endif
-#  endif
+#endif
 	return result;
 }
 #endif	/* !HAVE_NTP_GETTIME */


=====================================
ntptime/ntptime.c
=====================================
--- a/ntptime/ntptime.c
+++ b/ntptime/ntptime.c
@@ -60,11 +60,9 @@ int ntp_gettime(struct ntptimeval *ntv)
 	ntv->time = tntx.time;
 	ntv->maxerror = tntx.maxerror;
 	ntv->esterror = tntx.esterror;
-#  ifdef NTP_API
-#   if NTP_API > 3
+#if defined(STRUCT_NTPTIMEVAL_HAS_TAI)
 	ntv->tai = tntx.tai;
-#   endif
-#  endif
+#endif
 	return result;
 }
 #endif	/* !HAVE_NTP_GETTIME */
@@ -355,11 +353,11 @@ main(
 			       (int)time_frac,
 
 			       ctime_r((time_t *)&ntv.time.tv_sec, ascbuf));
-#if defined(STRUCT_NTPTIMEVAL_HAS_TAI) && NTP_API > 3
+#if defined(STRUCT_NTPTIMEVAL_HAS_TAI)
 		printf(json ? jfmt5 : ofmt5, (long)ntv.tai);
 #else
 		printf(json ? jfmt6 : ofmt6);
-#endif /* defined(STRUCT_NTPTIMEVAL_HAS_TAI) && NTP_API */
+#endif /* STRUCT_NTPTIMEVAL_HAS_TAI */
 	}
 	status = ntp_adjtime_ns(&ntx);
 	if (status < 0) {


=====================================
wafhelpers/configure.py
=====================================
--- a/wafhelpers/configure.py
+++ b/wafhelpers/configure.py
@@ -275,9 +275,6 @@ def cmd_configure(ctx, config):
         for header, sizeof in sorted(sizeofs, key=lambda x: x[1:]):
                 check_sizeof(ctx, header, sizeof)
 
-        # The protocol major number
-        ctx.define("NTP_API", 4, comment="Protocol major number.")
-
         ctx.define("NTP_KEYSDIR", "%s/etc" % ctx.env.PREFIX, comment="NTP key file directory")
         ctx.define("GETSOCKNAME_SOCKLEN_TYPE", "socklen_t", quote=False, comment="socklen type")
         ctx.define("DFLT_RLIMIT_STACK", 50, comment="Default stack size")



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/0014d865229f47cd568052478418788c2b1f42b1...84aa4d3cbc13fe90cb3c3a639adcf117a262c53d
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161210/26435231/attachment.html>


More information about the vc mailing list