diff options
author | Michael Adam <obnox@samba.org> | 2014-09-23 09:51:40 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-09-24 08:44:12 +0200 |
commit | db384efa40a7f688cb9cbedae1b214555b4f9eed (patch) | |
tree | e2578deb8c96668db77387fb7d3234f10d3e7edf | |
parent | 17055cca7bd130c3a82205e74ee696d97381fa28 (diff) | |
download | samba-db384efa40a7f688cb9cbedae1b214555b4f9eed.tar.gz samba-db384efa40a7f688cb9cbedae1b214555b4f9eed.tar.xz samba-db384efa40a7f688cb9cbedae1b214555b4f9eed.zip |
s3:torture: in LOCAL-MESSAGING-READ3, tell child to exit and wait
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
-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); |