diff options
-rw-r--r-- | source3/torture/test_messaging_read.c | 17 |
1 files changed, 17 insertions, 0 deletions
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); |