diff options
author | Colin Walters <walters@verbum.org> | 2010-02-18 15:33:28 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2010-02-18 15:33:28 -0500 |
commit | 9c90fcd2dc4b1b7d818a35ef43d4686052902f59 (patch) | |
tree | 52a6fb77f71a419756c4458f9c66ec08c8dac756 /bus/dir-watch-inotify.c | |
parent | 8ca10fd4ded0383e597b17ec315b955515e19a78 (diff) | |
download | dbus-9c90fcd2dc4b1b7d818a35ef43d4686052902f59.tar.gz |
Monitor service directories for changes
It's not expected to have to manually SIGHUP the bus after installing
a new .service file. Since our directory monitoring is already set
up to queue a full reload which includes service activation, simply
monitor the servicedirs too.
https://bugs.freedesktop.org/show_bug.cgi?id=23846
Diffstat (limited to 'bus/dir-watch-inotify.c')
-rw-r--r-- | bus/dir-watch-inotify.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bus/dir-watch-inotify.c b/bus/dir-watch-inotify.c index bb71394c..c98e6fcb 100644 --- a/bus/dir-watch-inotify.c +++ b/bus/dir-watch-inotify.c @@ -156,8 +156,18 @@ _set_watched_dirs_internal (DBusList **directories) wd = inotify_add_watch (inotify_fd, new_dirs[i], IN_CLOSE_WRITE | IN_DELETE | IN_MOVED_TO | IN_MOVED_FROM); if (wd < 0) { - _dbus_warn ("Cannot setup inotify for '%s'; error '%s'\n", new_dirs[i], _dbus_strerror (errno)); - goto out; + /* Not all service directories need to exist. */ + if (errno != ENOENT) + { + _dbus_warn ("Cannot setup inotify for '%s'; error '%s'\n", new_dirs[i], _dbus_strerror (errno)); + goto out; + } + else + { + new_wds[i] = -1; + new_dirs[i] = NULL; + continue; + } } new_wds[i] = wd; new_dirs[i] = _dbus_strdup (new_dirs[i]); |