summaryrefslogtreecommitdiff
blob: ee11149771cd908457cf69f4a2eeffcea79a95db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From 0f3f41a86842f2b19aa07af5242cb775ef9b20d3 Mon Sep 17 00:00:00 2001
From: "Jory A. Pratt" <anarchy@gentoo.org>
Date: Sat, 30 Jun 2018 22:44:22 -0500
Subject: [PATCH] Only include execinfo.h where avaliable

Signed-off-by: Jory A. Pratt <anarchy@gentoo.org>
---
 tests/test-coredump-unwind.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
index 5254708..33f92b0 100644
--- a/tests/test-coredump-unwind.c
+++ b/tests/test-coredump-unwind.c
@@ -57,7 +57,9 @@
 #include <grp.h>
 
 /* For SIGSEGV handler code */
+#if HAVE_EXECINFO_H
 #include <execinfo.h>
+#endif
 #include <sys/ucontext.h>
 
 #include <libunwind-coredump.h>
@@ -202,7 +204,7 @@ void die_out_of_memory(void)
 /* End of utility logging functions */
 
 
-
+#if HAVE_EXECINFO_H
 static
 void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
 {
@@ -249,12 +251,14 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
 
   _exit(1);
 }
-
+#endif
 static void install_sigsegv_handler(void)
 {
   struct sigaction sa;
   memset(&sa, 0, sizeof(sa));
+#if HAVE_EXECINFO_H
   sa.sa_sigaction = handle_sigsegv;
+#endif
   sa.sa_flags = SA_SIGINFO;
   sigaction(SIGSEGV, &sa, NULL);
   sigaction(SIGILL, &sa, NULL);
-- 
2.18.0