summaryrefslogtreecommitdiff
path: root/tests/backtrace-dwarf.c
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2018-02-15 14:44:18 +0100
committerMark Wielaard <mark@klomp.org>2018-02-15 14:55:39 +0100
commit4482d0009a99b1773f2426479b666b08f57af9d5 (patch)
tree675c48a48a3156da1d2f7c9a0db46c985691e73f /tests/backtrace-dwarf.c
parent212b4e3d431449056aed316331ee654611671513 (diff)
downloadelfutils-4482d0009a99b1773f2426479b666b08f57af9d5.tar.gz
Include sys/ptrace.h as early as possible.
On some systems, at least on Fedora 27 ppc64le with glibc 2.26-24 and kernel 4.14.18-300, including sys/ptrace.h late (after signal.h or sys/wait.h for example) will cause issues and produce errors like: In file included from /usr/include/asm/sigcontext.h:12:0, from /usr/include/bits/sigcontext.h:30, from /usr/include/signal.h:287, from /usr/include/sys/wait.h:36, from linux-pid-attach.c:38: /usr/include/sys/ptrace.h:73:3: error: expected identifier before numeric constant PTRACE_GETREGS = 12, ^ Swapping the include order fixes these issues. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'tests/backtrace-dwarf.c')
-rw-r--r--tests/backtrace-dwarf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c
index 2dc8a9a2..7ff826cd 100644
--- a/tests/backtrace-dwarf.c
+++ b/tests/backtrace-dwarf.c
@@ -17,7 +17,6 @@
#include <config.h>
#include <assert.h>
-#include <signal.h>
#include <inttypes.h>
#include <stdio_ext.h>
#include <locale.h>
@@ -25,7 +24,6 @@
#include <error.h>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/wait.h>
#include ELFUTILS_HEADER(dwfl)
#ifndef __linux__
@@ -40,6 +38,8 @@ main (int argc __attribute__ ((unused)), char **argv)
#else /* __linux__ */
#include <sys/ptrace.h>
+#include <sys/wait.h>
+#include <signal.h>
#define main cleanup_13_main
#include "cleanup-13.c"