[CRIU] [PATCH] test: write_read10 -- Wait for children to create
Cyrill Gorcunov
gorcunov at openvz.org
Mon Dec 21 11:21:29 PST 2015
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
test/zdtm/live/static/write_read10.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/test/zdtm/live/static/write_read10.c b/test/zdtm/live/static/write_read10.c
index 363384ad7844..28c12b67dcd5 100644
--- a/test/zdtm/live/static/write_read10.c
+++ b/test/zdtm/live/static/write_read10.c
@@ -22,6 +22,7 @@ int main(int argc, char ** argv)
pid_t pid;
uint32_t crc;
uint8_t buf[1000000];
+ task_waiter_t t;
test_init(argc, argv);
@@ -42,6 +43,8 @@ int main(int argc, char ** argv)
exit(1);
}
+ task_waiter_init(&t);
+
pid = fork();
if (pid < 0) {
pr_perror("can't fork");
@@ -49,6 +52,7 @@ int main(int argc, char ** argv)
}
if (pid == 0) { /* child writes to the unlinked file and returns */
+ task_waiter_complete_current(&t);
close(fd);
test_waitsig();
@@ -59,7 +63,8 @@ int main(int argc, char ** argv)
close(child_fd);
_exit(0);
- }
+ } else
+ task_waiter_wait4(&t, pid);
close(child_fd);
--
2.5.0
More information about the CRIU
mailing list