"%s zonename [ (filename|-) ]\n",
prog_name,
progmode == progmode_check ? "[-o filename]" : "-o filename");
- exit(1);
+ exit(EXIT_FAILURE);
}
static void
} else {
fprintf(stderr, "invalid argument to -i: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
} else {
fprintf(stderr, "invalid argument to -k: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
if (*endp != '\0') {
fprintf(stderr, "source serial number "
"must be numeric");
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
if (*endp != '\0') {
fprintf(stderr, "maximum TTL "
"must be numeric");
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
} else {
fprintf(stderr, "invalid argument to -n: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
} else {
fprintf(stderr, "invalid argument to -m: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
} else {
fprintf(stderr, "invalid argument to -r: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
fprintf(stderr,
"unknown or unsupported style: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
fprintf(stderr, "isc_dir_chroot: %s: %s\n",
isc_commandline_argument,
isc_result_totext(result));
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
} else {
fprintf(stderr, "invalid argument to -M: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
} else {
fprintf(stderr, "invalid argument to -S: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
} else {
fprintf(stderr, "invalid argument to -T: %s\n",
isc_commandline_argument);
- exit(1);
+ exit(EXIT_FAILURE);
}
break;
default:
fprintf(stderr, "%s: unhandled option -%c\n", prog_name,
isc_commandline_option);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "isc_dir_chdir: %s: %s\n", workdir,
isc_result_totext(result));
- exit(1);
+ exit(EXIT_FAILURE);
}
}
} else {
fprintf(stderr, "unknown file format: %s\n",
inputformatstr);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
rawversion > 1U)
{
fprintf(stderr, "unknown raw format version\n");
- exit(1);
+ exit(EXIT_FAILURE);
}
} else {
fprintf(stderr, "unknown file format: %s\n",
outputformatstr);
- exit(1);
+ exit(EXIT_FAILURE);
}
}
}
}
-void (*dighost_pre_exit_hook)(void) = NULL;
-
#if TARGET_OS_IPHONE
void
warn(const char *format, ...) {
exitcode = 10;
}
if (fatalexit != 0) {
- exitcode = fatalexit;
- }
- if (dighost_pre_exit_hook != NULL) {
- dighost_pre_exit_hook();
+ _exit(fatalexit);
}
exit(exitcode);
}
vfprintf(stderr, format, args);
va_end(args);
fprintf(stderr, "\n");
+ if (fatalexit == 0 && exitcode != 0) {
+ fatalexit = exitcode;
+ } else if (fatalexit == 0) {
+ fatalexit = EXIT_FAILURE;
+ }
digexit();
}
#endif /* HAVE_LMDB */
#ifndef SIZE_MAX
-#define SIZE_MAX ((size_t) - 1)
+#define SIZE_MAX ((size_t)-1)
#endif /* ifndef SIZE_MAX */
#ifndef SIZE_AS_PERCENT
-#define SIZE_AS_PERCENT ((size_t) - 2)
+#define SIZE_AS_PERCENT ((size_t)-2)
#endif /* ifndef SIZE_AS_PERCENT */
#ifdef TUNE_LARGE
#define CHECKFATAL(op, msg) \
do { \
result = (op); \
- if (result != ISC_R_SUCCESS) \
+ if (result != ISC_R_SUCCESS) { \
fatal(server, msg, result); \
+ } \
} while (0)
/*%
NAMED_LOGMODULE_SERVER, ISC_LOG_CRITICAL,
"exiting (due to fatal error)");
named_os_shutdown();
- exit(1);
+ _exit(1);
}
static void