From db384efa40a7f688cb9cbedae1b214555b4f9eed Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Tue, 23 Sep 2014 09:51:40 +0200 Subject: s3:torture: in LOCAL-MESSAGING-READ3, tell child to exit and wait Signed-off-by: Michael Adam Reviewed-by: Stefan Metzmacher --- source3/torture/test_messaging_read.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source3/torture/test_messaging_read.c b/source3/torture/test_messaging_read.c index 757b83eb34..a51ae4f1b3 100644 --- a/source3/torture/test_messaging_read.c +++ b/source3/torture/test_messaging_read.c @@ -396,6 +396,7 @@ bool run_messaging_read3(int dummy) int ret; char c; struct server_id dst; + ssize_t written; if ((pipe(ready_pipe) != 0) || (pipe(exit_pipe) != 0)) { perror("pipe failed"); @@ -442,6 +443,22 @@ bool run_messaging_read3(int dummy) goto fail; } + printf("Parent: telling child to exit\n"); + + written = write(exit_pipe[1], &c, 1); + if (written != 1) { + perror("write to exit_pipe failed"); + goto fail; + } + + ret = waitpid(child, NULL, 0); + if (ret == -1) { + perror("waitpid failed"); + goto fail; + } + + printf("Parent: child exited. Done\n"); + retval = true; fail: TALLOC_FREE(msg_ctx); -- cgit