From cc7a6b0db9c5c429a56e5a751650f9e2c4a95485 Mon Sep 17 00:00:00 2001 From: Guenther Deschner Date: Dec 17 2009 17:47:57 +0000 Subject: Fix inotify.patch. Guenther --- diff --git a/samba-3.2.5-inotify.patch b/samba-3.2.5-inotify.patch index 8e6ebb2..31b8952 100644 --- a/samba-3.2.5-inotify.patch +++ b/samba-3.2.5-inotify.patch @@ -1,7 +1,6 @@ -=== modified file 'source/smbd/notify_inotify.c' ---- source3/smbd/notify_inotify.c 2007-03-09 12:07:58 +0000 -+++ source3/smbd/notify_inotify.c 2007-04-10 16:27:47 +0000 -@@ -66,6 +66,7 @@ +--- source3/smbd/notify_inotify.c.inotify 2009-12-15 09:25:26.000000000 +0100 ++++ source3/smbd/notify_inotify.c 2009-12-17 18:42:06.000000000 +0100 +@@ -75,6 +75,7 @@ struct sys_notify_context *ctx; int fd; struct inotify_watch_context *watches; @@ -9,13 +8,12 @@ }; struct inotify_watch_context { -@@ -229,8 +230,16 @@ +@@ -239,8 +240,15 @@ filenames, and thus can't know how much to allocate otherwise */ - if (ioctl(in->fd, FIONREAD, &bufsize) != 0 || - bufsize == 0) { -+ + if ((ioctl(in->fd, FIONREAD, &bufsize) != 0) && (errno == EACCES)) { + /* + * Workaround for broken system (SELinux policy bug fixed since long but it is always better not to loop on EACCES) @@ -26,9 +24,9 @@ + } + if (bufsize == 0) { DEBUG(0,("No data on inotify fd?!\n")); + TALLOC_FREE(fde); return; - } -@@ -281,6 +290,7 @@ +@@ -297,6 +305,7 @@ } in->ctx = ctx; in->watches = NULL; @@ -36,7 +34,7 @@ ctx->private_data = in; talloc_set_destructor(in, inotify_destructor); -@@ -375,6 +385,10 @@ +@@ -391,6 +400,10 @@ in = talloc_get_type(ctx->private_data, struct inotify_private); @@ -47,4 +45,3 @@ mask = inotify_map(e); if (mask == 0) { /* this filter can't be handled by inotify */ -