[Git][NTPsec/ntpsec][master] Address GitLab issue #289: ntpfrob/tickadj broken (warnings)...

Eric S. Raymond gitlab at mg.gitlab.com
Thu May 4 19:37:56 UTC 2017


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


Commits:
eadf30cd by Eric S. Raymond at 2017-05-04T15:37:42-04:00
Address GitLab issue #289: ntpfrob/tickadj broken (warnings)...

...on NetBSD and FreeBSD and OpenBSD.

No actual logic change.

- - - - -


2 changed files:

- ntpfrob/main.c
- ntpfrob/tickadj.c


Changes:

=====================================
ntpfrob/main.c
=====================================
--- a/ntpfrob/main.c
+++ b/ntpfrob/main.c
@@ -41,10 +41,18 @@ main(int argc, char **argv)
                 got_one = true;
 		switch (ch) {
 		case 'A':
+#ifndef HAVE_ADJTIMEX
 		    tickadj(mode==json, 0);
+#else
+		    fputs("ntpfrob: no adjtimex(2)\n", stderr);
+#endif /* HAVE_ADJTIMEX */
 		    break;
 		case 'a':
+#ifndef HAVE_ADJTIMEX
 		    tickadj(mode, atoi(optarg));
+#else
+		    fputs("ntpfrob: no adjtimex(2)\n", stderr);
+#endif /* HAVE_ADJTIMEX */
 		    break;
 		case 'b':
 		    bumpclock(atoi(optarg));


=====================================
ntpfrob/tickadj.c
=====================================
--- a/ntpfrob/tickadj.c
+++ b/ntpfrob/tickadj.c
@@ -25,16 +25,9 @@
 # include <sys/timex.h>
 
 static struct timex txc;
-#endif /* HAVE_ADJTIMEX */
 
 void tickadj(const bool json_b, const int newtick)
 {
-#ifndef HAVE_ADJTIMEX
-	UNUSED_ARG(json_b);
-	UNUSED_ARG(newtick);
-	fputs("ntpfrob: \n", stderr);
-	exit(1);
-#else
 	if (newtick != 0)
 	{
 #ifdef HAVE_STRUCT_TIMEX_TIME_TICK
@@ -90,7 +83,8 @@ void tickadj(const bool json_b, const int newtick)
 #endif /* HAVE_STRUCT_TIMEX_TIME_TICK */
 	}
 
-#endif /* HAVE_ADJTIMEX */
 }
 
+#endif /* HAVE_ADJTIMEX */
+
 /* end */



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

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/eadf30cd4703a7c47223fda09955a592de39b8b2
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/20170504/c57e72e0/attachment.html>


More information about the vc mailing list