From bf27e58c2f1ce897a222a63bc1771716e90d5672 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 14 May 2007 00:58:24 +0000 Subject: r22831: take advantage of EVENT_FD_AUTOCLOSE in the inotify code (This used to be commit 419ef7393f9208e274745808980e0342e2e65a37) --- source4/ntvfs/sysdep/inotify.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c index fbbf6e4010..cc612d8f9a 100644 --- a/source4/ntvfs/sysdep/inotify.c +++ b/source4/ntvfs/sysdep/inotify.c @@ -79,16 +79,6 @@ struct inotify_watch_context { }; -/* - 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 @@ static NTSTATUS inotify_setup(struct sys_notify_context *ctx) 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; } -- cgit