2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Use EXIT_SUCCESS and EXIT_FAILURE

Instead of randomly using -1 or 1 as a failure status, properly utilize
the EXIT_FAILURE define that's platform specific (as it should be).
This commit is contained in:
Ondřej Surý
2024-02-07 14:50:38 +01:00
parent e140743e6a
commit 76997983fd
41 changed files with 153 additions and 150 deletions

View File

@@ -38,7 +38,7 @@ check_result(isc_result_t result, const char *format, ...) {
vfprintf(stderr, format, args);
va_end(args);
fprintf(stderr, ": %s\n", isc_result_totext(result));
exit(1);
exit(EXIT_FAILURE);
}
static void
@@ -52,7 +52,7 @@ usage(void) {
fprintf(stderr, "usage: cfg_test --rndc|--named "
"[--grammar] [--zonegrammar] [--active] "
"[--memstats] conffile\n");
exit(1);
exit(EXIT_FAILURE);
}
int
@@ -166,7 +166,7 @@ main(int argc, char **argv) {
fprintf(stderr, "read config: %s\n", isc_result_totext(result));
if (result != ISC_R_SUCCESS) {
exit(1);
exit(EXIT_FAILURE);
}
cfg_print(cfg, output, NULL);
@@ -186,7 +186,7 @@ main(int argc, char **argv) {
if (ferror(stdout)) {
fprintf(stderr, "write error\n");
return (1);
} else {
return (0);
}
return (0);
}