svn commit: samba r11982 - in branches/SAMBA_4_0/source/libcli/raw: .

tridge at samba.org tridge at samba.org
Thu Dec 1 00:22:12 GMT 2005


Author: tridge
Date: 2005-12-01 00:22:08 +0000 (Thu, 01 Dec 2005)
New Revision: 11982

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11982

Log:

ensure the fde event gets freed before the socket itself, as otherwise
we get a error from epoll about disabling events for a file descriptor
that is closed


Modified:
   branches/SAMBA_4_0/source/libcli/raw/clisocket.c
   branches/SAMBA_4_0/source/libcli/raw/clitransport.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/raw/clisocket.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/clisocket.c	2005-12-01 00:19:36 UTC (rev 11981)
+++ branches/SAMBA_4_0/source/libcli/raw/clisocket.c	2005-12-01 00:22:08 UTC (rev 11982)
@@ -179,10 +179,10 @@
 ****************************************************************************/
 void smbcli_sock_dead(struct smbcli_socket *sock)
 {
-	if (sock->sock != NULL) {
-		talloc_free(sock->sock);
-		sock->sock = NULL;
-	}
+	talloc_free(sock->event.fde);
+	sock->event.fde = NULL;
+	talloc_free(sock->sock);
+	sock->sock = NULL;
 }
 
 /****************************************************************************

Modified: branches/SAMBA_4_0/source/libcli/raw/clitransport.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/raw/clitransport.c	2005-12-01 00:19:36 UTC (rev 11981)
+++ branches/SAMBA_4_0/source/libcli/raw/clitransport.c	2005-12-01 00:22:08 UTC (rev 11982)
@@ -115,7 +115,7 @@
 	   handles events up until we are connected */
 	talloc_free(transport->socket->event.fde);
 	transport->socket->event.fde = event_add_fd(transport->socket->event.ctx,
-						    transport->socket,
+						    transport->socket->sock,
 						    socket_get_fd(transport->socket->sock),
 						    EVENT_FD_READ,
 						    smbcli_transport_event_handler,



More information about the samba-cvs mailing list