[CRIU] [PATCH] test/libcriu: inlude all required headers

Andrew Vagin avagin at openvz.org
Thu Jun 4 05:58:05 PDT 2015


Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin at openvz.org>
---
 test/libcriu/test_errno.c  | 3 +++
 test/libcriu/test_iters.c  | 4 +++-
 test/libcriu/test_notify.c | 4 ++++
 test/libcriu/test_sub.c    | 5 ++++-
 4 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/test/libcriu/test_errno.c b/test/libcriu/test_errno.c
index c312be9..185c3f0 100644
--- a/test/libcriu/test_errno.c
+++ b/test/libcriu/test_errno.c
@@ -5,6 +5,9 @@
 #include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
 
 #define PID_MAX "/proc/sys/kernel/pid_max"
 
diff --git a/test/libcriu/test_iters.c b/test/libcriu/test_iters.c
index c2c674b..a29f415 100644
--- a/test/libcriu/test_iters.c
+++ b/test/libcriu/test_iters.c
@@ -6,6 +6,8 @@
 #include <signal.h>
 #include <fcntl.h>
 #include <sys/stat.h>
+#include <sys/wait.h>
+#include <unistd.h>
 #include "lib.h"
 
 static int wdir_fd, cur_iter = 1, cur_imgdir = -1;
@@ -115,7 +117,7 @@ int main(int argc, char **argv)
 	}
 
 	printf("   `- Dump succeeded\n");
-	wait(pid, NULL, 0);
+	waitpid(pid, NULL, 0);
 
 	printf("--- Restore loop ---\n");
 	criu_init_opts();
diff --git a/test/libcriu/test_notify.c b/test/libcriu/test_notify.c
index 7455795..3839362 100644
--- a/test/libcriu/test_notify.c
+++ b/test/libcriu/test_notify.c
@@ -4,6 +4,10 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <signal.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
 #include "lib.h"
 
 #define SUCC_ECODE	42
diff --git a/test/libcriu/test_sub.c b/test/libcriu/test_sub.c
index 161a671..f67dc00 100644
--- a/test/libcriu/test_sub.c
+++ b/test/libcriu/test_sub.c
@@ -4,6 +4,9 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <signal.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 #include "lib.h"
 
 static int stop = 0;
@@ -78,7 +81,7 @@ int main(int argc, char **argv)
 	}
 
 	printf("   `- Dump succeeded\n");
-	wait(pid, NULL, 0);
+	waitpid(pid, NULL, 0);
 
 	printf("--- Restore loop ---\n");
 	criu_init_opts();
-- 
2.4.2



More information about the CRIU mailing list