[ntpsec commit] Revert to not trying to build ntptickadj ubless adjtimex is present...

Eric S. Raymond esr at ntpsec.org
Fri Oct 9 10:37:40 UTC 2015


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

Author:    Eric S. Raymond <esr at thyrsus.com>
Date:      Fri Oct  9 06:35:52 2015 -0400

Revert to not trying to build ntptickadj ubless adjtimex is present...

....turns out the FreeBSD atruct timex is missing its tick member.

---

 docs/ntptickadj-body.txt |  2 +-
 util/ntptickadj.c        | 17 ++++-------------
 util/wscript             |  6 +++++-
 3 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/docs/ntptickadj-body.txt b/docs/ntptickadj-body.txt
index 0963d6e..0397d95 100644
--- a/docs/ntptickadj-body.txt
+++ b/docs/ntptickadj-body.txt
@@ -10,7 +10,7 @@
 
 The `{ntptickadj}` program (formerly named just `tickadj`) reads, and
 optionally modifies, several timekeeping-related variables.  It relies
-on the adjtimex(2) or ntp_adjtime(2) system calls.
+on the adjtimex(2) system call.
 
 These tweaks are almost never necessary on hardware new enough to have
 a fully POSIX.1-2001-conformant Unix. This utility is deprecated and
diff --git a/util/ntptickadj.c b/util/ntptickadj.c
index 53e098b..7029ac4 100644
--- a/util/ntptickadj.c
+++ b/util/ntptickadj.c
@@ -1,9 +1,9 @@
 /*
  * ntptickadj - read, and possibly modify, the kernel `tick' and
- *	     `tickadj' variables', using adjtimex(2) or
- *	     ntp_adjtime(2).  This is included only for compatibility
- *	     with old scripts.  and its former support for unsafe
- *	     /dev/kmem operations has been removed.
+ *	     `tickadj' variables', using adjtimex(2).  This is
+ *	     included only for compatibility with old scripts.
+ *	     and its former support for unsafe /dev/kmem operations
+ *	     has been removed.
  */
 
 #include <config.h>
@@ -66,19 +66,10 @@ int main(
 #endif
 	}
 
-#ifdef HAVE_ADJTIMEX
 	if (adjtimex(&txc) < 0)
 	{
 		perror("adjtimex");
 	}
-#elif HAVE_NTP_ADJTIME
-	if (ntp_adjtime(&txc) < 0)
-	{
-		perror("ntp_adjtime");
-	}
-#else
-#error Either adjtimex or ntp_adjtime(2) is required.
-#endif
 	else
 	{
 #ifdef STRUCT_TIMEX_HAS_TIME_TICK
diff --git a/util/wscript b/util/wscript
index b3d554c..446ee26 100644
--- a/util/wscript
+++ b/util/wscript
@@ -4,11 +4,15 @@ def build(ctx):
 	srcnode = ctx.srcnode.abspath()
 	bldnode = ctx.bldnode.abspath()
 
-	util = ['hist', 'jitter', 'ntptickadj', 'precision', 'propdelay', 'ntptime', 'sht', 'testrs6000', 'tg2']
+	util = ['hist', 'jitter', 'precision', 'propdelay',
+		'ntptime', 'sht', 'testrs6000', 'tg2']
 
 	if ctx.get_define("HAVE_SYS_TIMEPPS_H"):
 		util += ["pps-api"]
 
+	if ctx.get_define("HAVE_ADJTIMEX"):
+		util += ["ntptickadj"]
+
 	for name in util:
 		ctx(
 			target		= name,



More information about the vc mailing list