~leon_plickat/wlopm

06ae5c5f6efbea3ffe058dc1c5066c12e3019d33 — Leon Henrik Plickat 2 months ago c61cbb4 master
Only include execinfo.h when glibc is used
1 files changed, 5 insertions(+), 0 deletions(-)

M wlopm.c
M wlopm.c => wlopm.c +5 -0
@@ 28,8 28,11 @@
#include <wayland-client.h>

#ifdef __linux__
#include <features.h>
#ifdef __GLIBC__
#include<execinfo.h>
#endif
#endif

#include "xdg-output-unstable-v1.h"
#include "wlr-output-power-management-unstable-v1.h"


@@ 432,6 435,7 @@ static void handle_error (int signum)
	fputs(msg, stderr);

#ifdef __linux__
#ifdef __GLIBC__
	fputs("Attempting to get backtrace:\n", stderr);

	/* In some rare cases, getting a backtrace can also cause a segfault.


@@ 443,6 447,7 @@ static void handle_error (int signum)
	backtrace_symbols_fd(buffer, calls, fileno(stderr));
	fputs("\n", stderr);
#endif
#endif

	/* Let the default handlers deal with the rest. */
	signal(signum, SIG_DFL);