svn commit: samba r22831 - in branches/SAMBA_4_0/source/ntvfs/sysdep: .

tridge at samba.org tridge at samba.org
Mon May 14 00:58:25 GMT 2007


Author: tridge
Date: 2007-05-14 00:58:24 +0000 (Mon, 14 May 2007)
New Revision: 22831

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

Log:

take advantage of EVENT_FD_AUTOCLOSE in the inotify code

Modified:
   branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c


Changeset:
Modified: branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c
===================================================================
--- branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c	2007-05-14 00:57:48 UTC (rev 22830)
+++ branches/SAMBA_4_0/source/ntvfs/sysdep/inotify.c	2007-05-14 00:58:24 UTC (rev 22831)
@@ -80,16 +80,6 @@
 
 
 /*
-  destroy the inotify private context
-*/
-static int inotify_destructor(struct inotify_private *in)
-{
-	close(in->fd);
-	return 0;
-}
-
-
-/*
   see if a particular event from inotify really does match a requested
   notify event in SMB
 */
@@ -271,10 +261,9 @@
 	in->watches = NULL;
 
 	ctx->private_data = in;
-	talloc_set_destructor(in, inotify_destructor);
 
 	/* add a event waiting for the inotify fd to be readable */
-	event_add_fd(ctx->ev, in, in->fd, EVENT_FD_READ, inotify_handler, in);
+	event_add_fd(ctx->ev, in, in->fd, EVENT_FD_READ|EVENT_FD_AUTOCLOSE, inotify_handler, in);
 	
 	return NT_STATUS_OK;
 }



More information about the samba-cvs mailing list