summaryrefslogtreecommitdiff
path: root/bus/dir-watch-inotify.c
AgeCommit message (Collapse)AuthorFilesLines
2013-08-23fix whitespaceSimon McVittie1-1/+1
2013-08-23Cleanup: polish inotify backendChengwei Yang1-9/+7
At previous, it will do get pid and print a verbose string per inotify event, and then do send signal to the daemon. This patch changes the behavior to get pid and print a verbose string one time. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=68303 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-02-21Fix inotify usage for QNXMatt Fischer1-0/+4
QNX's copy of sys/inotify.h is broken, and doesn't include stdint.h even though it refers to types from it. Therefore, it must be included manually. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61176 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2011-06-13DBusLoop: remove second layer of watch callbacks where possibleSimon McVittie1-9/+2
Similar to the previous commit, almost every use of DBusWatch can just have the main loop call dbus_watch_handle. The one exception is the bus activation code; it's had a comment explaining why it's wrong since 2003. We should fix that one day, but for now, just migrate it to a new _dbus_loop_add_watch_full which preserves the second-layer callback. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342 Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-06-13Always remove, invalidate and free watches before closing watched socketsSimon McVittie1-2/+4
This should mean we don't get invalid fds in the main loop. The BSD (kqueue) and Windows code paths are untested, but follow the same patterns as the tested Linux/generic Unix versions. DBusTransportSocket was already OK (it called free_watches() before _dbus_close_socket, and that did the remove, invalidate, unref dance). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk> Reviewed-by: Thiago Macieira <thiago@kde.org>
2011-01-17handle failure to register inotify shutdown functionChristian Dywan1-1/+7
Origin: vendor, Maemo Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33128 Bug-NB: NB#180486 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2010-03-16Merge branch 'dbus-1.2'Colin Walters1-0/+5
Conflicts: bus/bus.c configure.in
2010-03-16Support inotify on older kernelsColin Walters1-0/+5
https://bugs.freedesktop.org/show_bug.cgi?id=23957 Previously we detected glibc support at compile time and used it unconditionally; better to try it and fall back, this way we continue to run on older kernels when compiled for newer ones.
2010-02-22Merge branch 'dbus-1.2'Colin Walters1-2/+12
Conflicts: bus/bus.c bus/selinux.c configure.in
2010-02-18Monitor service directories for changesColin Walters1-2/+12
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
2010-02-03Fix inotify shutdownColin Walters1-46/+82
We were incorrectly passing NULL for a DBusList when the usage expected is a pointer to a NULL DBusList pointer. Also during dbus_shutdown we need to actually close the inotify fd, and remove our watch. Move the shutdown handler out of bus.c and into inotify where we can do all of this cleanly. (cherry picked from commit 90fe96b1875350f86a4a773d4a0a22009950dd4d)
2010-02-02Fix inotify shutdownColin Walters1-46/+82
We were incorrectly passing NULL for a DBusList when the usage expected is a pointer to a NULL DBusList pointer. Also during dbus_shutdown we need to actually close the inotify fd, and remove our watch. Move the shutdown handler out of bus.c and into inotify where we can do all of this cleanly.
2010-02-01Merge branch 'my-dbus-1.2'Colin Walters1-46/+104
2010-02-01Clean up inotify watch handlingColin Walters1-46/+104
Substantially based on a patch by Matthias Clasen <mclasen@redhat.com> kqueue implementation by Joe Marcus Clarke <marcus@freebsd.org> Previously, when we detected a configuration change (which included the set of config directories to monitor for changes), we would simply drop all watches, then readd them. The problem with this is that it introduced a race condition where we might not be watching one of the config directories for changes. Rather than dropping and readding, change the OS-dependent monitoring API to simply take a new set of directories to monitor. Implicit in this is that the OS-specific layer needs to keep track of the previously monitored set.
2009-07-16Merge branch 'fd-passing'Thiago Macieira1-1/+0
Conflicts: dbus/dbus-connection.c dbus/dbus-message-util.c dbus/dbus-sysdeps-unix.c
2009-07-14Bug 22516 - Ensure inotify fd is set close on execMatthias Clasen1-0/+4
This prevents it leaking into spawned child processes. Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit f4e15893e5be6da6c7642bb7ef9b14d5531afe41)
2009-07-14Bug 21161 - Update the FSF addressTobias Mueller1-1/+1
No comment. Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit 5baf2f856a9c6625993234855b07680da1c8916f)
2009-07-10Bug 22516 - Ensure inotify fd is set close on execMatthias Clasen1-0/+4
This prevents it leaking into spawned child processes. Signed-off-by: Colin Walters <walters@verbum.org>
2009-07-10Bug 21161 - Update the FSF addressTobias Mueller1-1/+1
No comment. Signed-off-by: Colin Walters <walters@verbum.org>
2009-05-20build-system: define _GNU_SOURCE centrallyLennart Poettering1-1/+0
Instead of having everyone define _GNU_SOURCE and similar macros seperately, simply do so centrally by using AC_USE_SYSTEM_EXTENSIONS
2008-07-28Bug 16294: Don't lose inotify watch when config fails to parseColin Walters1-9/+12
* bus/dir-watch-inotify.c: Always drop the watch in handle_inotify_watch; this ensures we always readd it correctly in bus_drop_all_directory_watches.
2008-04-01Fixes for the inotify configuration file monitor backend.Frederic Crozat1-3/+3
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-01-17fix inotify supportJohn (J5) Palmieri1-29/+36
2008-01-17 Timo Hoenig <thoenig@suse.de> * fix inotify support * bus/dir-watch-inotify.c (_handle_inotify_watch): fix reading of the inotify events. Also, use ssize_t not size_t for 'ret'. * bus/dir-watch-inotify.c (bus_watch_directory): watch not only for IN_MODIFY but also for IN_CREATE and IN_DELETE * bus/dir-watch-inotify.c (bus_drop_all_directory_watches): drop the inotify watches more elegantly by closing inotify:_fd, set inotify_fd to -1 after dropping the watches
2008-01-14add inotify support (FDO Bz#13268)John (J5) Palmieri1-0/+156
2008-01-14 John (J5) Palmieri <johnp@redhat.com> * patch by Frederic Crozat <fcrozat at mandriva dot com> (FDO Bz# 13268) * add inotify support * bus/Makefile.am: add inotify module to the build * bus/dir-watch-inotify.c: inotify module based off the dnotify and kqueue modules * configure.in: add checks and switch for inotify also add a printout at the end of configure if inotify and kqueue support is being built in (dnotify already had this)