diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-07 15:03:56 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-02-07 15:04:25 +0000 |
commit | 88498b706a39bbe520f9591d8d52b54fb1f8e378 (patch) | |
tree | 5243eb3c97b8039d0ff43cd7121a632bbdb9d3bc /test | |
parent | b816cb6e900073c6a6126687f2102dfd8e594e68 (diff) | |
parent | 3f4ed9def33c359142c340f28345755ca37663f2 (diff) | |
download | dbus-88498b706a39bbe520f9591d8d52b54fb1f8e378.tar.gz |
Merge branch 'socket-set-33337'
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33337
Diffstat (limited to 'test')
-rw-r--r-- | test/test-utils.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/test/test-utils.c b/test/test-utils.c index 4fd84fe8..c3c3ed34 100644 --- a/test/test-utils.c +++ b/test/test-utils.c @@ -26,6 +26,15 @@ remove_watch (DBusWatch *watch, _dbus_loop_remove_watch (cd->loop, watch); } +static void +toggle_watch (DBusWatch *watch, + void *data) +{ + CData *cd = data; + + _dbus_loop_toggle_watch (cd->loop, watch); +} + static dbus_bool_t add_timeout (DBusTimeout *timeout, void *data) @@ -103,15 +112,10 @@ test_connection_setup (DBusLoop *loop, if (cd == NULL) goto nomem; - /* Because dbus-mainloop.c checks dbus_timeout_get_enabled(), - * dbus_watch_get_enabled() directly, we don't have to provide - * "toggled" callbacks. - */ - if (!dbus_connection_set_watch_functions (connection, add_watch, remove_watch, - NULL, + toggle_watch, cd, cdata_free)) goto nomem; @@ -213,6 +217,15 @@ add_server_watch (DBusWatch *watch, } static void +toggle_server_watch (DBusWatch *watch, + void *data) +{ + ServerData *context = data; + + _dbus_loop_toggle_watch (context->loop, watch); +} + +static void remove_server_watch (DBusWatch *watch, void *data) { @@ -252,7 +265,7 @@ test_server_setup (DBusLoop *loop, if (!dbus_server_set_watch_functions (server, add_server_watch, remove_server_watch, - NULL, + toggle_server_watch, sd, serverdata_free)) { |