summaryrefslogtreecommitdiff
path: root/bus/dir-watch-kqueue.c
AgeCommit message (Collapse)AuthorFilesLines
2014-01-06kqueue: open watched directories with close-on-exec flagChengwei Yang1-1/+1
[FreeBSD and OpenBSD contributors clarified that O_CLOEXEC has been supported for ~ 2 years on both, so for the moment we're assuming that every platform with kqueue also has working O_CLOEXEC. Please reopen the bug, with a tested patch that uses _dbus_fd_set_close_on_exec() instead, if this assumption turns out to be false. -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=72213 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-06Fix memory leak for kqueue: shutdown kqueue correctlyChengwei Yang1-13/+74
There are memory blocks leak when doing bus-test, both dispatch-sha1 and dispatch test cases complain memory blocks leak. This patch also fix fd leaks. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69332 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2014-01-06kqueue: replace tab with spaceChengwei Yang1-51/+51
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69332 [altered commit message to not say it fixes memory leaks -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
2013-06-26kqueue: remove unused variableChengwei Yang1-1/+1
Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66035
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>
2010-05-21kqueue set_watched_dirs: fix termination conditionWill Thompson1-1/+1
num_fds is the number of elements of dirs currently in use. This bug meant that encountering a previously un-watched directory would cause j to increment forever, and so dirs[j] would eventually segfault. (I've checked the corresponding code for inotify, and it's correct. I wonder if some of the duplication could be eliminated.) Thanks to Pablo Martí Gamboa <pmarti@warp.es> for reporting this issue!
2010-02-18Monitor service directories for changesColin Walters1-4/+13
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-08Fix compilation of kqueue file monitoring on FreeBSDCyril Brulebois1-4/+5
2010-02-01Clean up inotify watch handlingColin Walters1-36/+100
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-14Bug 21161 - Update the FSF addressTobias Mueller1-1/+1
No comment. Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit 5baf2f856a9c6625993234855b07680da1c8916f)
2007-07-142007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington1-1/+1
* Add indent-tabs-mode: nil to all file headers.
2007-06-152007-06-15 Havoc Pennington <hp@redhat.com>Havoc Pennington1-0/+4
* dbus/dbus-sysdeps.c (_dbus_set_errno_to_zero) (_dbus_get_is_errno_nonzero, _dbus_get_is_errno_eintr) (_dbus_strerror_from_errno): family of functions to abstract errno, though these are somewhat bogus (really we should make our socket wrappers not use errno probably - the issue is that any usage of errno that isn't socket-related probably is not cross-platform, so should either be in a unix-only file that can use errno directly, or is a bug - these general errno wrappers hide issues of this nature in non-socket code, while socket-specific API changes would not since sockets are allowed cross-platform)
2006-10-19* bus/dir-watch-default.c, bus/dir-watch-dnotify.c,John (J5) Palmieri1-2/+2
bus/dir-watch-kqueue.c (bus_watch_directory): Pass in a BusContext instead of a void *. kqueue uses this to get the context's loop while the other modules ignore the parameter. This allows us to avoid platform conditionals * bus/bus.c (process_config_postinit): Pass in the context to the watch
2006-08-08* dbus/dbus-sysdeps.h:John (J5) Palmieri1-0/+177
* dbus/dbus-sysdeps.c: * dbus/dbus-string.c: s/_dbus_printf_length/_dbus_printf_string_upper_bound to comform with GLib's function which does the same thing * configure.in: * bus/Makefile.am: * bus/dir-watch-default.c: * bus/dir-watch-dnotify.c: * bus/dir-watch-kqueue.c: Add kqueue directory watching for freebsd and split the directory watching code into seperate files per method/arch (patches from Timothy Redaelli <drizzt at gufi dotorg>)