diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-01-21 18:54:33 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2011-06-13 16:09:50 +0100 |
commit | 4b43f5db7a3570978b49cb3adca3ca4afc95f8aa (patch) | |
tree | 78b1aafc50f2101507c880c090cac769ac5d9f74 /bus/main.c | |
parent | 93385b733927bdcfd5c6e97f9684820aa9d3d4ae (diff) | |
download | dbus-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/main.c')
-rw-r--r-- | bus/main.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -220,14 +220,6 @@ handle_reload_watch (DBusWatch *watch, return TRUE; } -static dbus_bool_t -reload_watch_callback (DBusWatch *watch, - unsigned int condition, - void *data) -{ - return dbus_watch_handle (watch, condition); -} - static void setup_reload_pipe (DBusLoop *loop) { @@ -257,8 +249,7 @@ setup_reload_pipe (DBusLoop *loop) exit (1); } - if (!_dbus_loop_add_watch (loop, watch, reload_watch_callback, - NULL, NULL)) + if (!_dbus_loop_add_watch (loop, watch)) { _dbus_warn ("Unable to add reload watch to main loop: %s\n", error.message); @@ -271,8 +262,7 @@ setup_reload_pipe (DBusLoop *loop) static void close_reload_pipe (DBusWatch **watch) { - _dbus_loop_remove_watch (bus_context_get_loop (context), - *watch, reload_watch_callback, NULL); + _dbus_loop_remove_watch (bus_context_get_loop (context), *watch); _dbus_watch_invalidate (*watch); _dbus_watch_unref (*watch); *watch = NULL; |