mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-09 07:18:03 +02:00
Fixes for the inotify configuration file monitor backend.
2008-04-01 Timo Hoenig <thoenig@suse.de> Patch from Frederic Crozat <fcrozat@mandriva.com> * bus/dir-watch-inotify.c (bus_watch_directory): Only monitor IN_CLOSE_WRITE, IN_DELETE, IN_MOVE_TO and IN_MOVE_FROM events. This way, only atomic changes to configuration file are monitored. * bus/dir-watch-inotify.c (_handle_inotify_watch): Fix typo in _dbus_verbose function call * bus/dir-watch-inotify.c (bus_drop_all_directory_watches): Use _dbus_strerror instead of perror
This commit is contained in:
parent
0bfc5e8d23
commit
68f69d3818
2 changed files with 15 additions and 3 deletions
12
ChangeLog
12
ChangeLog
|
|
@ -1,3 +1,15 @@
|
|||
2008-04-01 Timo Hoenig <thoenig@suse.de>
|
||||
|
||||
Patch from Frederic Crozat <fcrozat@mandriva.com>
|
||||
|
||||
* bus/dir-watch-inotify.c (bus_watch_directory): Only monitor
|
||||
IN_CLOSE_WRITE, IN_DELETE, IN_MOVE_TO and IN_MOVE_FROM events. This
|
||||
way, only atomic changes to configuration file are monitored.
|
||||
* bus/dir-watch-inotify.c (_handle_inotify_watch): Fix typo in
|
||||
_dbus_verbose function call
|
||||
* bus/dir-watch-inotify.c (bus_drop_all_directory_watches): Use
|
||||
_dbus_strerror instead of perror
|
||||
|
||||
2008-03-31 Colin Walters <walters@verbum.org>
|
||||
|
||||
Patch from Owen Taylor <otaylor@redhat.com>
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ _handle_inotify_watch (DBusWatch *watch, unsigned int flags, void *data)
|
|||
|
||||
ret = read (inotify_fd, buffer, INOTIFY_BUF_LEN);
|
||||
if (ret < 0)
|
||||
_dbus_verbose ("Error reading inotify event: '%s'\n, _dbus_strerror(errno)");
|
||||
_dbus_verbose ("Error reading inotify event: '%s'\n", _dbus_strerror(errno));
|
||||
else if (!ret)
|
||||
_dbus_verbose ("Error reading inotify event: buffer too small\n");
|
||||
|
||||
|
|
@ -134,7 +134,7 @@ bus_watch_directory (const char *dir, BusContext *context)
|
|||
goto out;
|
||||
}
|
||||
|
||||
wd = inotify_add_watch (inotify_fd, dir, IN_MODIFY | IN_CREATE | IN_DELETE);
|
||||
wd = inotify_add_watch (inotify_fd, dir, IN_CLOSE_WRITE | IN_DELETE | IN_MOVED_TO | IN_MOVED_FROM);
|
||||
if (wd < 0)
|
||||
{
|
||||
_dbus_warn ("Cannot setup inotify for '%s'; error '%s'\n", dir, _dbus_strerror (errno));
|
||||
|
|
@ -156,7 +156,7 @@ bus_drop_all_directory_watches (void)
|
|||
_dbus_verbose ("Dropping all watches on config directories\n");
|
||||
ret = close (inotify_fd);
|
||||
if (ret)
|
||||
_dbus_verbose ("Error dropping watches: '%s'\n", perror(ret));
|
||||
_dbus_verbose ("Error dropping watches: '%s'\n", _dbus_strerror(errno));
|
||||
|
||||
num_wds = 0;
|
||||
inotify_fd = -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue