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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user