[PATCH] fix inotify support

Timo Hoenig thoenig at suse.de
Thu Jan 17 08:43:54 PST 2008


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.

Thanks,

   Timo

[1] http://lists.freedesktop.org/archives/dbus/2008-January/009150.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbus-inotify-fix-thoenig-01.patch
Type: text/x-patch
Size: 4045 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20080117/b7bc94d8/attachment.bin 


More information about the dbus mailing list