[ntpsec commit] Port ntptime so it reliably compiles under FreeBSD.

Eric S. Raymond esr at ntpsec.org
Tue Oct 20 03:22:02 UTC 2015


Module:    ntpsec
Branch:    master
Commit:    f91429a8df5540ea778ff63c97422bad4a0b4475
Changeset: http://git.ntpsec.org/ntpsec/commit/?id=f91429a8df5540ea778ff63c97422bad4a0b4475

Author:    Eric S. Raymond <esr at thyrsus.com>
Date:      Tue Oct 20 03:20:54 2015 +0000

Port ntptime so it reliably compiles under FreeBSD.

---

 docs/includes/ntptime-body.txt | 3 +--
 ntptime/ntptime.c              | 2 +-
 pylib/check_structfield.py     | 2 +-
 pylib/configure.py             | 2 +-
 wscript                        | 2 +-
 5 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/docs/includes/ntptime-body.txt b/docs/includes/ntptime-body.txt
index 06aae78..6793894 100644
--- a/docs/includes/ntptime-body.txt
+++ b/docs/includes/ntptime-body.txt
@@ -14,8 +14,7 @@ Checks the kernel configuration for the NTP user interface
 syscalls +ntp_gettime()+ and +ntp_adjtime()+.  If present, the current
 timekeeping data are displayed.  If not, a disappointment is
 displayed.  See the kernel page file in the HTML documentation in
-distribution for further details. {ntptime} will be built if the
-configuration system believes your platform can use it.
+distribution for further details.
 
 A similar display can be obtained using the +{ntpq}+ program
 and +kerninfo+ command.
diff --git a/ntptime/ntptime.c b/ntptime/ntptime.c
index 44907b3..fcf0324 100644
--- a/ntptime/ntptime.c
+++ b/ntptime/ntptime.c
@@ -20,7 +20,7 @@
 #include <setjmp.h>
 #include <stdbool.h>
 
-#ifdef STRUCT_NTP_TIMEVAL_HAS_TV_NSEC
+#ifdef STRUCT_NTPTIMEVAL_HAS_TIME_TV_NSEC
 #define tv_frac_sec tv_nsec
 #else
 #define tv_frac_sec tv_usec
diff --git a/pylib/check_structfield.py b/pylib/check_structfield.py
index 76377c2..f775ec9 100644
--- a/pylib/check_structfield.py
+++ b/pylib/check_structfield.py
@@ -14,7 +14,7 @@ int main () {
 
 @conf
 def check_structfield(ctx, fld, type, hdr, mandatory=False):
-	name = "STRUCT_%s_HAS_%s" % (type.upper(), fld.upper())
+	name = "STRUCT_%s_HAS_%s" % (type.upper(), fld.upper().replace('.','_'))
 
 	ctx.check_cc(
 		fragment    = TYPE_FRAG % (hdr, type, fld),
diff --git a/pylib/configure.py b/pylib/configure.py
index 5482ca8..10d2f8a 100644
--- a/pylib/configure.py
+++ b/pylib/configure.py
@@ -125,7 +125,7 @@ def cmd_configure(ctx):
 	structure_fields = (
 		("time_tick", "timex", "sys/timex.h"),
 		("modes", "timex", "sys/timex.h"),
-		("tv_nsec", "ntptimeval", "sys/timex.h"),
+		("time.tv_nsec", "ntptimeval", "sys/timex.h"),
 		)
 	for (f, s, h) in structure_fields:
 		ctx.check_structfield(f, s, h)
diff --git a/wscript b/wscript
index 30f5af9..334420a 100644
--- a/wscript
+++ b/wscript
@@ -104,7 +104,7 @@ def build(ctx):
 	ctx.recurse("ntpq")
 	ctx.recurse("ntpkeygen") 
 	#if ctx.env.PLATFORM_TARGET != "freebsd": # XXX: fix this using a test in configure().
-	#	ctx.recurse("ntptime")
+	ctx.recurse("ntptime")
 	ctx.recurse("util")
 #	ctx.recurse("tests")
 



More information about the vc mailing list