From 7ea4e06275f0178461ac8417c5f12233f3064023 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlo=20Marcelo=20Arenas=20Bel=C3=B3n?= Date: Mon, 3 Jun 2019 15:32:38 -0700 Subject: [PATCH] tools: hscollider FTBS in alpine linux alpine uses musl instead of glibc and therefore doesn't have backtrace() as part of its libc. POSIX mandates that _exit() be defined through unistd.h which used to be included together with execinfo.h when backtrace() was detected and therefore it happened to build fine for linux or freebsd (when using libexecinfo from the system or ports). since there was a macro already defined to test for unistd.h use that instead and decouple this dependency, so that the code could be built even when no backtrace() is provided (as expected also in OpenBSD) --- tools/hscollider/sig.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/hscollider/sig.cpp b/tools/hscollider/sig.cpp index dc815140..7d580e41 100644 --- a/tools/hscollider/sig.cpp +++ b/tools/hscollider/sig.cpp @@ -42,7 +42,10 @@ #ifdef HAVE_BACKTRACE #include -#include +#endif + +#ifdef HAVE_UNISTD_H +#include // for _exit #endif #define BACKTRACE_BUFFER_SIZE 200