[Git][NTPsec/ntpsec][master] Fix some misleading error codes.

Eric S. Raymond gitlab at mg.gitlab.com
Sat Jul 2 13:35:30 UTC 2016


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


Commits:
1cb07cd8 by Eric S. Raymond at 2016-07-02T09:34:35-04:00
Fix some misleading error codes.

- - - - -


2 changed files:

- docs/includes/ntpdig-body.txt
- ntpdig/main.c


Changes:

=====================================
docs/includes/ntpdig-body.txt
=====================================
--- a/docs/includes/ntpdig-body.txt
+++ b/docs/includes/ntpdig-body.txt
@@ -231,6 +231,8 @@ One of the following exit values will be returned:
   Successful program execution.
 1 (EXIT_FAILURE)::
   The operation failed or the command syntax was not valid.
+2::
+  Internal error - libevent failed to initialize properly.
 
 == AUTHORS ==
 


=====================================
ntpdig/main.c
=====================================
--- a/ntpdig/main.c
+++ b/ntpdig/main.c
@@ -118,8 +118,6 @@ void dec_pending_ntp(const char *, sockaddr_u *);
 bool libevent_version_ok(void);
 int  gettimeofday_cached(struct event_base *b, struct timeval *tv);
 
-#define EXIT_SOFTWARE	70
-
 #define ALL_OPTIONS "46a:b:c:dD:g:hjK:k:l:M:o:rSst:VwW"
 static const struct option longoptions[] = {
     { "ipv4",		    0, 0, '4' },
@@ -214,7 +212,7 @@ ntpdig_main (
 	ntpdig_init_logging(argv[0]);
 
 	if (!libevent_version_ok())
-		exit(EXIT_SOFTWARE);
+		exit(2);
 
 	init_lib();
 	init_auth();
@@ -332,7 +330,7 @@ ntpdig_main (
 	if (0 == argc && !opt_broadcast && !opt_concurrent) {
 		printf("%s: Must supply at least one of -b hostname, -c hostname, or hostname.\n",
 		       progname);
-		exit(EXIT_SOFTWARE);
+		exit(1);
 	}
 
 
@@ -1627,7 +1625,7 @@ set_time(
 		*/
 	}
 
-	return EXIT_SOFTWARE;
+	return EXIT_FAILURE;
 }
 
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/1cb07cd8546bc30db54021e4dc15a6ceb54c2eaf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160702/034c6131/attachment.html>


More information about the vc mailing list