summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/backtrace-child.c2
-rw-r--r--tests/backtrace-dwarf.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 5f7bcddb..ebcd7bcc 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,8 @@
+2017-04-20 Ulf Hermann <[email protected]>
+
+ * backtrace-child.c: Include sys/ptrace.h only on linux.
+ * backtrace-dwarf.c: Likewise.
+
2017-04-05 Mark Wielaard <[email protected]>
* test-subr.sh (testrun_on_self_compressed): New function.
diff --git a/tests/backtrace-child.c b/tests/backtrace-child.c
index cf4547ca..2c27414f 100644
--- a/tests/backtrace-child.c
+++ b/tests/backtrace-child.c
@@ -83,7 +83,6 @@
#include <stdlib.h>
#include <signal.h>
#include <errno.h>
-#include <sys/ptrace.h>
#include <string.h>
#include <pthread.h>
#include <stdio.h>
@@ -100,6 +99,7 @@ main (int argc __attribute__ ((unused)), char **argv)
}
#else /* __linux__ */
+#include <sys/ptrace.h>
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
#define NOINLINE_NOCLONE __attribute__ ((noinline, noclone))
diff --git a/tests/backtrace-dwarf.c b/tests/backtrace-dwarf.c
index a644c8ab..2dc8a9a2 100644
--- a/tests/backtrace-dwarf.c
+++ b/tests/backtrace-dwarf.c
@@ -24,7 +24,6 @@
#include <errno.h>
#include <error.h>
#include <unistd.h>
-#include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h>
#include ELFUTILS_HEADER(dwfl)
@@ -40,6 +39,7 @@ main (int argc __attribute__ ((unused)), char **argv)
}
#else /* __linux__ */
+#include <sys/ptrace.h>
#define main cleanup_13_main
#include "cleanup-13.c"