summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-05 10:43:34 +1100
committerAndrew Tridgell <tridge@samba.org>2010-03-05 11:54:36 +1100
commit2d30f4fb4fd39fb0949cd948559725917f95742f (patch)
tree78e5aa3f1f6484a80398f30f0bb54a0e85bec6de
parent5573d049414d75e9991d53627235cafefbe67470 (diff)
downloadsamba-2d30f4fb4fd39fb0949cd948559725917f95742f.tar.gz
samba-2d30f4fb4fd39fb0949cd948559725917f95742f.tar.bz2
samba-2d30f4fb4fd39fb0949cd948559725917f95742f.zip
s4-dns-ex: use autoclose on the dns child pipe
I'm hoping this will fix an occasional segfault I've noticed where epoll still calls events on a closed fde Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/libcli/resolve/dns_ex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c
index 79ed78340c..423668d4b6 100644
--- a/source4/libcli/resolve/dns_ex.c
+++ b/source4/libcli/resolve/dns_ex.c
@@ -67,7 +67,6 @@ static int dns_ex_destructor(struct dns_ex_state *state)
int status;
kill(state->child, SIGTERM);
- close(state->child_fd);
if (waitpid(state->child, &status, WNOHANG) == 0) {
kill(state->child, SIGKILL);
waitpid(state->child, &status, 0);
@@ -369,7 +368,6 @@ static void pipe_handler(struct tevent_context *ev, struct tevent_fd *fde,
} else {
ret = -1;
}
- close(state->child_fd);
if (waitpid(state->child, &status, WNOHANG) == 0) {
kill(state->child, SIGKILL);
waitpid(state->child, &status, 0);
@@ -498,6 +496,7 @@ struct composite_context *resolve_name_dns_ex_send(TALLOC_CTX *mem_ctx,
close(fd[1]);
return c;
}
+ tevent_fd_set_auto_close(state->fde);
state->child = fork();
if (state->child == (pid_t)-1) {