diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-01-03 12:47:24 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-01-03 19:58:53 +0100 |
commit | 5fa0d3d56824f4ef3dfdb0f97c836554a62c4875 (patch) | |
tree | 6973a352fc244df2641655e9c645f319a0632970 /source4/libcli | |
parent | b1be241ca5d7f02be93bd3582b98d428b1e207ce (diff) | |
download | samba-5fa0d3d56824f4ef3dfdb0f97c836554a62c4875.tar.gz samba-5fa0d3d56824f4ef3dfdb0f97c836554a62c4875.tar.bz2 samba-5fa0d3d56824f4ef3dfdb0f97c836554a62c4875.zip |
s4:socket: use a socket_wrapper aware function to auto close the fd event for sockets
metze
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/ldap/ldap_client.c | 7 |
1 files changed, 4 insertions, 3 deletions
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); |