[Git][NTPsec/ntpsec][master] Make sure ntpd -VVV only outputs the version information once, instead of 3x.

Matt Selsky gitlab at mg.gitlab.com
Tue Jan 17 06:03:02 UTC 2017


Matt Selsky pushed to branch master at NTPsec / ntpsec


Commits:
100045af by Matt Selsky at 2017-01-17T01:02:05-05:00
Make sure ntpd -VVV only outputs the version information once, instead of 3x.

ntpd's extended version information was removed in "Generate ntpd version
string with autorevision."

- - - - -


1 changed file:

- ntpd/ntpd.c


Changes:

=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -232,7 +232,6 @@ parse_cmdline_opts(
 	)
 {
 	static bool	parsed = false;
-	bool sawV = false;
 
 	if (parsed)
 	    return;
@@ -378,9 +377,8 @@ parse_cmdline_opts(
 		}
 		break;
 	    case 'V':
-		sawV = true;
 		printf("%s\n", ntpd_version());
-		break;
+		exit(0);
 	    case 'w':
 		wait_sync = strtod(ntp_optarg, NULL);
 		break;
@@ -417,9 +415,6 @@ parse_cmdline_opts(
 		cmdline_server_count = argc - ntp_optind;
 		cmdline_servers = argv + ntp_optind;
 	}
-
-	if (sawV)
-		exit(0);
 }
 
 #ifdef NO_MAIN_ALLOWED



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/100045af45f9addd8852f1336d9e2b7670fb032e
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170117/19029cd0/attachment.html>


More information about the vc mailing list