summaryrefslogtreecommitdiff
path: root/bus/dir-watch-kqueue.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-01-21 18:54:33 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-06-13 16:09:50 +0100
commit4b43f5db7a3570978b49cb3adca3ca4afc95f8aa (patch)
tree78b1aafc50f2101507c880c090cac769ac5d9f74 /bus/dir-watch-kqueue.c
parent93385b733927bdcfd5c6e97f9684820aa9d3d4ae (diff)
downloaddbus-4b43f5db7a3570978b49cb3adca3ca4afc95f8aa.tar.gz
DBusLoop: remove second layer of watch callbacks where possible
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>
Diffstat (limited to 'bus/dir-watch-kqueue.c')
-rw-r--r--bus/dir-watch-kqueue.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/bus/dir-watch-kqueue.c b/bus/dir-watch-kqueue.c
index 62f7b3dc..ac6290cc 100644
--- a/bus/dir-watch-kqueue.c
+++ b/bus/dir-watch-kqueue.c
@@ -50,12 +50,6 @@ static DBusWatch *watch = NULL;
static DBusLoop *loop = NULL;
static dbus_bool_t
-_kqueue_watch_callback (DBusWatch *watch, unsigned int condition, void *data)
-{
- return dbus_watch_handle (watch, condition);
-}
-
-static dbus_bool_t
_handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data)
{
struct kevent ev;
@@ -80,7 +74,7 @@ _handle_kqueue_watch (DBusWatch *watch, unsigned int flags, void *data)
kq = -1;
if (watch != NULL)
{
- _dbus_loop_remove_watch (loop, watch, _kqueue_watch_callback, NULL);
+ _dbus_loop_remove_watch (loop, watch);
_dbus_watch_invalidate (watch);
_dbus_watch_unref (watch);
watch = NULL;
@@ -121,8 +115,7 @@ _init_kqueue (BusContext *context)
goto out;
}
- if (!_dbus_loop_add_watch (loop, watch, _kqueue_watch_callback,
- NULL, NULL))
+ if (!_dbus_loop_add_watch (loop, watch))
{
_dbus_warn ("Unable to add reload watch to main loop");
_dbus_watch_invalidate (watch);