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-kqueue.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-kqueue.c')
-rw-r--r-- | bus/dir-watch-kqueue.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bus/dir-watch-kqueue.c b/bus/dir-watch-kqueue.c index e7b0e2c5..4a01b748 100644 --- a/bus/dir-watch-kqueue.c +++ b/bus/dir-watch-kqueue.c @@ -204,11 +204,20 @@ bus_set_watched_dirs (BusContext *context, DBusList **directories) * we may need to sleep. */ fd = open (new_dirs[i], O_RDONLY); - if (fd < 0) + if (fd < 0) { - _dbus_warn ("Cannot open directory '%s'; error '%s'\n", new_dirs[i], _dbus_strerror (errno)); - goto out; - } + if (errno != ENOENT) + { + _dbus_warn ("Cannot open directory '%s'; error '%s'\n", new_dirs[i], _dbus_strerror (errno)); + goto out; + } + else + { + new_fds[i] = -1; + new_dirs[i] = NULL; + continue; + } + } EV_SET (&ev, fd, EVFILT_VNODE, EV_ADD | EV_ENABLE | EV_CLEAR, NOTE_DELETE | NOTE_EXTEND | NOTE_WRITE | NOTE_RENAME, 0, 0); |