Fix inotify.patch.
Guenther
This commit is contained in:
parent
83398d05b0
commit
cc7a6b0db9
@ -1,7 +1,6 @@
|
|||||||
=== modified file 'source/smbd/notify_inotify.c'
|
--- source3/smbd/notify_inotify.c.inotify 2009-12-15 09:25:26.000000000 +0100
|
||||||
--- source3/smbd/notify_inotify.c 2007-03-09 12:07:58 +0000
|
+++ source3/smbd/notify_inotify.c 2009-12-17 18:42:06.000000000 +0100
|
||||||
+++ source3/smbd/notify_inotify.c 2007-04-10 16:27:47 +0000
|
@@ -75,6 +75,7 @@
|
||||||
@@ -66,6 +66,7 @@
|
|
||||||
struct sys_notify_context *ctx;
|
struct sys_notify_context *ctx;
|
||||||
int fd;
|
int fd;
|
||||||
struct inotify_watch_context *watches;
|
struct inotify_watch_context *watches;
|
||||||
@ -9,13 +8,12 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct inotify_watch_context {
|
struct inotify_watch_context {
|
||||||
@@ -229,8 +230,16 @@
|
@@ -239,8 +240,15 @@
|
||||||
filenames, and thus can't know how much to allocate
|
filenames, and thus can't know how much to allocate
|
||||||
otherwise
|
otherwise
|
||||||
*/
|
*/
|
||||||
- if (ioctl(in->fd, FIONREAD, &bufsize) != 0 ||
|
- if (ioctl(in->fd, FIONREAD, &bufsize) != 0 ||
|
||||||
- bufsize == 0) {
|
- bufsize == 0) {
|
||||||
+
|
|
||||||
+ if ((ioctl(in->fd, FIONREAD, &bufsize) != 0) && (errno == EACCES)) {
|
+ 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)
|
+ * 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) {
|
+ if (bufsize == 0) {
|
||||||
DEBUG(0,("No data on inotify fd?!\n"));
|
DEBUG(0,("No data on inotify fd?!\n"));
|
||||||
|
TALLOC_FREE(fde);
|
||||||
return;
|
return;
|
||||||
}
|
@@ -297,6 +305,7 @@
|
||||||
@@ -281,6 +290,7 @@
|
|
||||||
}
|
}
|
||||||
in->ctx = ctx;
|
in->ctx = ctx;
|
||||||
in->watches = NULL;
|
in->watches = NULL;
|
||||||
@ -36,7 +34,7 @@
|
|||||||
|
|
||||||
ctx->private_data = in;
|
ctx->private_data = in;
|
||||||
talloc_set_destructor(in, inotify_destructor);
|
talloc_set_destructor(in, inotify_destructor);
|
||||||
@@ -375,6 +385,10 @@
|
@@ -391,6 +400,10 @@
|
||||||
|
|
||||||
in = talloc_get_type(ctx->private_data, struct inotify_private);
|
in = talloc_get_type(ctx->private_data, struct inotify_private);
|
||||||
|
|
||||||
@ -47,4 +45,3 @@
|
|||||||
mask = inotify_map(e);
|
mask = inotify_map(e);
|
||||||
if (mask == 0) {
|
if (mask == 0) {
|
||||||
/* this filter can't be handled by inotify */
|
/* this filter can't be handled by inotify */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user