aboutsummaryrefslogtreecommitdiffstats
path: root/dftest.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2023-01-11 09:56:26 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2023-01-11 09:56:26 +0000
commitfc013d9bd60783478c672a95904c8ce4c3d68de4 (patch)
tree83234aab10023f7da873fa6b053fea0b60cc950b /dftest.c
parent4f7c3ab16ad65270fc10ab3fe17a80286b32a17d (diff)
Set unique exit codes for processes
Diffstat (limited to 'dftest.c')
-rw-r--r--dftest.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/dftest.c b/dftest.c
index 6c29148324..5844ee6762 100644
--- a/dftest.c
+++ b/dftest.c
@@ -39,6 +39,7 @@
#include "ui/cmdarg_err.h"
#include "ui/failure_message.h"
#include "ui/version_info.h"
+#include "ui/exit_codes.h"
static int opt_verbose = 0;
#define DFTEST_LOG_NONE 0
@@ -280,13 +281,13 @@ main(int argc, char **argv)
case 1000:
if (strlen(ws_optarg) > 1 || !g_ascii_isdigit(*ws_optarg)) {
printf("Error: \"%s\" is not a valid number 0-9\n", ws_optarg);
- print_usage(EXIT_FAILURE);
+ print_usage(INVALID_OPTION);
}
errno = 0;
opt_optimize = strtol(ws_optarg, NULL, 10);
if (errno) {
printf("Error: %s\n", g_strerror(errno));
- print_usage(EXIT_FAILURE);
+ print_usage(INVALID_OPTION);
}
break;
case 2000:
@@ -398,7 +399,7 @@ main(int argc, char **argv)
/* Expand macros. */
expanded_text = expand_filter(text, timer);
if (expanded_text == NULL) {
- exit_status = 2;
+ exit_status = INVALID_FILTER;
goto out;
}
@@ -407,7 +408,7 @@ main(int argc, char **argv)
/* Compile it */
if (!compile_filter(expanded_text, &df, timer)) {
- exit_status = 2;
+ exit_status = INVALID_FILTER;
goto out;
}
@@ -418,7 +419,7 @@ main(int argc, char **argv)
if (df == NULL) {
printf("Filter is empty.\n");
- exit_status = 1;
+ exit_status = INVALID_FILTER;
goto out;
}