[Git][NTPsec/ntpsec][master] 2 commits: Add a listing of compiled-in clocks to the ntpd usage message.

Eric S. Raymond gitlab at mg.gitlab.com
Sun Jul 10 00:05:15 UTC 2016


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


Commits:
a701f5bd by Eric S. Raymond at 2016-07-09T20:01:20-04:00
Add a listing of compiled-in clocks to the ntpd usage message.

- - - - -
87e6f850 by Eric S. Raymond at 2016-07-09T20:04:48-04:00
Magic-number elimination.

- - - - -


2 changed files:

- ntpd/ntp_parser.y
- ntpd/ntpd.c


Changes:

=====================================
ntpd/ntp_parser.y
=====================================
--- a/ntpd/ntp_parser.y
+++ b/ntpd/ntp_parser.y
@@ -487,11 +487,11 @@ option_int
 			{ $$ = create_attr_uval($1, $2); }
 	|	T_Stratum T_Integer
 		{
-			if ($2 >= 0 && $2 <= 16) {
+			if ($2 >= 0 && $2 <= STRATUM_UNSPEC) {
 				$$ = create_attr_ival($1, $2);
 			} else {
 				$$ = NULL;
-				yyerror("fudge factor: stratum value not in [0..16], ignored");
+				yyerror("fudge factor: stratum value out of boands, ignored");
 			}
 		}
 	;


=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -241,6 +241,19 @@ static void ntpd_usage(void)
     P("   -x no  slew           Slew up to 600 seconds\n");
     P("   -V no  version        Output version information and exit\n");
     P("   -h no  help           Display extended usage information and exit\n");
+#ifdef REFCLOCK
+    P("This version was compiled with the following clock drivers:\n");
+    int ct = 0;
+    for (int dtype = 1; dtype < (int)num_refclock_conf; dtype++)
+	if (refclock_conf[dtype]->basename != NULL)
+	{
+	    fprintf(stderr, "%12s", refclock_conf[dtype]->basename);
+	    if (((++ct % 5) == 0))
+		fputc('\n', stderr);
+	}
+    if (ct % 5)
+	fputc('\n', stderr);
+#endif /* REFCLOCK */
 #undef P
 }
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/754b822a784f273fa51e3e71e815928acbcaba5e...87e6f85068ae0d626150f9df6d1ad8ccdc83a913
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160710/52a0365f/attachment.html>


More information about the vc mailing list