summaryrefslogtreecommitdiff
path: root/bus/test.c
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-01-21 18:54:09 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-06-13 16:07:17 +0100
commit93385b733927bdcfd5c6e97f9684820aa9d3d4ae (patch)
tree8c7df46ef96aa9e1983365cadf87b0f5742ed4bb /bus/test.c
parentb8ccef11bbbc13b6ab74daaa76d9a9463f99b009 (diff)
downloaddbus-93385b733927bdcfd5c6e97f9684820aa9d3d4ae.tar.gz
DBusLoop: remove a layer of pointless abstraction around timeouts
Instead of supplying 8 tiny wrapper functions around dbus_timeout_handle, each with a user_data parameter that's a potentially unsafe borrowed pointer but isn't actually used, we can call dbus_timeout_handle directly and save a lot of trouble. One of the wrappers previously called dbus_timeout_handle repeatedly if it returned FALSE to indicate OOM, but that timeout's handler never actually returned FALSE, so there was no practical effect. The rest just ignore the return, which is documented as OK to do. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33342 Reviewed-by: Thiago Macieira <thiago@kde.org>
Diffstat (limited to 'bus/test.c')
-rw-r--r--bus/test.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/bus/test.c b/bus/test.c
index 95c7cfb8..8d16340e 100644
--- a/bus/test.c
+++ b/bus/test.c
@@ -70,23 +70,13 @@ remove_client_watch (DBusWatch *watch,
watch, client_watch_callback, connection);
}
-static void
-client_timeout_callback (DBusTimeout *timeout,
- void *data)
-{
- DBusConnection *connection = data;
-
- /* can return FALSE on OOM but we just let it fire again later */
- dbus_timeout_handle (timeout);
-}
-
static dbus_bool_t
add_client_timeout (DBusTimeout *timeout,
void *data)
{
DBusConnection *connection = data;
- return _dbus_loop_add_timeout (client_loop, timeout, client_timeout_callback, connection, NULL);
+ return _dbus_loop_add_timeout (client_loop, timeout);
}
static void
@@ -95,7 +85,7 @@ remove_client_timeout (DBusTimeout *timeout,
{
DBusConnection *connection = data;
- _dbus_loop_remove_timeout (client_loop, timeout, client_timeout_callback, connection);
+ _dbus_loop_remove_timeout (client_loop, timeout);
}
static DBusHandlerResult