Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
int ret;
char c;
struct server_id dst;
+ ssize_t written;
if ((pipe(ready_pipe) != 0) || (pipe(exit_pipe) != 0)) {
perror("pipe failed");
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);