[PATCH 1/2] test: include headers for used funcs

Mike Frysinger vapier at gentoo.org
Thu May 2 19:43:45 UTC 2013


These funcs use things like wait/write/read/strcmp but sometimes don't
include the right header for them.

* Makefile: Add -Wall to CFLAGS.
* clone.c: Include unistd.h.
* fork.c: Include sys/wait.h.
* sig.c: Include unistd.h.
* sigkill_rain.c: Include sys/wait.h.
* vfork.c: Include sys/wait.h.
* wait_must_be_interruptible.c: Include string.h
---
 test/Makefile                     | 2 ++
 test/clone.c                      | 1 +
 test/fork.c                       | 1 +
 test/sig.c                        | 1 +
 test/sigkill_rain.c               | 1 +
 test/vfork.c                      | 1 +
 test/wait_must_be_interruptible.c | 1 +
 7 files changed, 8 insertions(+)

diff --git a/test/Makefile b/test/Makefile
index c6ce99c..781e1f6 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,3 +1,5 @@
+CFLAGS += -Wall
+
 all: \
     vfork fork sig skodic clone leaderkill childthread \
     sigkill_rain wait_must_be_interruptible threaded_execve
diff --git a/test/clone.c b/test/clone.c
index 5de302f..bdce8b1 100644
--- a/test/clone.c
+++ b/test/clone.c
@@ -4,6 +4,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <sched.h>
+#include <unistd.h>
 
 int child(void* arg)
 {
diff --git a/test/fork.c b/test/fork.c
index 9bed1fe..1425e2d 100644
--- a/test/fork.c
+++ b/test/fork.c
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <unistd.h>
+#include <sys/wait.h>
 
 int main(int argc, char *argv[])
 {
diff --git a/test/sig.c b/test/sig.c
index 60a9dc9..1678b02 100644
--- a/test/sig.c
+++ b/test/sig.c
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <signal.h>
+#include <unistd.h>
 
 void interrupt()
 {
diff --git a/test/sigkill_rain.c b/test/sigkill_rain.c
index e2350db..59af55b 100644
--- a/test/sigkill_rain.c
+++ b/test/sigkill_rain.c
@@ -5,6 +5,7 @@
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <stdio.h>
+#include <sys/wait.h>
 
 static const struct sockaddr sa;
 
diff --git a/test/vfork.c b/test/vfork.c
index 367dc01..f49a473 100644
--- a/test/vfork.c
+++ b/test/vfork.c
@@ -1,5 +1,6 @@
 #include <stdlib.h>
 #include <unistd.h>
+#include <sys/wait.h>
 
 int main(int argc, char *argv[])
 {
diff --git a/test/wait_must_be_interruptible.c b/test/wait_must_be_interruptible.c
index 931ec4c..3fb3449 100644
--- a/test/wait_must_be_interruptible.c
+++ b/test/wait_must_be_interruptible.c
@@ -3,6 +3,7 @@
 #include <signal.h>
 #include <sys/wait.h>
 #include <stdio.h>
+#include <string.h>
 
 /* Expected order is:
  * Child signals parent
-- 
1.8.2.1





More information about the Strace-devel mailing list