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

Use _exit() in the fatal() function

Since the fatal() isn't a correct but rather abrupt termination of the
program, we want to skip the various atexit() calls because not all
memory might be freed during fatal() call, etc.  Using _exit() instead
of exit() has this effect - the program will end, but no destructors or
atexit routines will be called.
This commit is contained in:
Ondřej Surý
2024-02-07 14:44:39 +01:00
parent 4e2e2a13b7
commit 4bec711fe3
13 changed files with 48 additions and 39 deletions

View File

@@ -194,7 +194,7 @@ named_main_earlyfatal(const char *format, ...) {
}
va_end(args);
exit(1);
_exit(EXIT_FAILURE);
}
noreturn static void
@@ -233,7 +233,7 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
if (named_g_coreok) {
abort();
}
exit(1);
_exit(EXIT_FAILURE);
}
noreturn static void
@@ -273,7 +273,7 @@ library_fatal_error(const char *file, int line, const char *func,
if (named_g_coreok) {
abort();
}
exit(1);
_exit(EXIT_FAILURE);
}
static void