From 5fa0d3d56824f4ef3dfdb0f97c836554a62c4875 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 12:47:24 +0100 Subject: s4:socket: use a socket_wrapper aware function to auto close the fd event for sockets metze --- source4/libcli/ldap/ldap_client.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source4/libcli') diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index 18784135cc..8c68103997 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -387,14 +387,15 @@ static void ldap_connect_got_sock(struct composite_context *ctx, struct ldap_connection *conn) { /* setup a handler for events on this socket */ - conn->event.fde = event_add_fd(conn->event.event_ctx, conn->sock, - socket_get_fd(conn->sock), - EVENT_FD_READ | EVENT_FD_AUTOCLOSE, ldap_io_handler, conn); + conn->event.fde = tevent_add_fd(conn->event.event_ctx, conn->sock, + socket_get_fd(conn->sock), + TEVENT_FD_READ, ldap_io_handler, conn); if (conn->event.fde == NULL) { composite_error(ctx, NT_STATUS_INTERNAL_ERROR); return; } + tevent_fd_set_close_fn(conn->event.fde, socket_tevent_fd_close_fn); socket_set_flags(conn->sock, SOCKET_FLAG_NOCLOSE); talloc_steal(conn, conn->sock); -- cgit