Gate #include <execinfo.h> behind #ifdef HAVE_BACKTRACE

execinfo.h is unnecessary if HAVE_BACKTRACE is not defined.
This increases portability for systems without execinfo.h
This commit is contained in:
Nils 2024-07-23 03:13:05 +01:00 committed by Bernd Schubert
parent 37bc4eb03c
commit febea554d3

View File

@ -16,9 +16,12 @@
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <execinfo.h>
#include <errno.h>
#ifdef HAVE_BACKTRACE
#include <execinfo.h>
#endif
static int teardown_sigs[] = { SIGHUP, SIGINT, SIGTERM };
static int ignore_sigs[] = { SIGPIPE};
static int fail_sigs[] = { SIGILL, SIGTRAP, SIGABRT, SIGBUS, SIGFPE, SIGSEGV };