[PATCH] fix inotify support

Frederic Crozat fcrozat at mandriva.com
Tue Jan 22 06:01:17 PST 2008


Le mardi 22 janvier 2008 à 14:39 +0100, Michael Biebl a écrit :
> 2008/1/17, Timo Hoenig <thoenig at suse.de>:
> > Hi,
> >
> > Michael's report [1] seems to be caused by the broken inotify support
> > which is now enabled by default.
> >
> > Simply copy an existing configuration file (e.g.
> > cp /etc/dbus-1/system.de/hal.conf /etc/dbus-1/system.de/test.conf)
> > while D-Bus is running to see what happens ;-)  I wonder if anybody has
> > tested this before committing?
> >
> > The attached patch addresses the issues.
> >
> > * fix reading of the inotify events. Also, use ssize_t not size_t for
> >   'ret'.
> > * watch not only for IN_MODIFY but also for IN_CREATE and IN_DELETE
> > * drop the inotify watches more elegantly by closing inotify_fd
> > * set inotify_fd after dropping the watches so that bus_watch_diretory
> >   can successfully initialize inotify again
> >
> > Please review.
> >
> 
> Hi Timo,
> 
> dbus-1.1.4, which contains your patch, does no longer crash for me.
> Unfortunately, the monitoring of /etc/dbus-1/system.d doesn't seem to
> work either.
> If I install a (new) config file there, dbus-daemon doesn't recognize
> it. I have to reload dbus to pick up the changed configuration.
> Obviously I have inotify/dnotify support available in the kernel.
> 
> Any idea what's going wrong here?

That is strange, because I tested Timo patch when he posted it and I
could confirm it does monitor /etc/dbus-1/system.d for file creation /
modification and removal correctly.

-- 
Frederic Crozat <fcrozat at mandriva.com>
Mandriva



More information about the dbus mailing list