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

@@ -13,14 +13,16 @@
/*! \file */
#include "util.h"
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <isc/tls.h>
#include "util.h"
extern bool verbose;
extern const char *progname;
@@ -46,5 +48,5 @@ fatal(const char *format, ...) {
va_end(args);
fprintf(stderr, "\n");
isc__tls_setfatalmode();
exit(1);
_exit(EXIT_FAILURE);
}