summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2003-01-18 17:40:42 +0000
committerHavoc Pennington <hp@redhat.com>2003-01-18 17:40:42 +0000
commit0363701c341796278041fb9ea7de80eaaf41479a (patch)
tree005dc8da9378917aad6cf57636b2c2558ec108bb /test
parent6ac750b03fb32591769d0a6ece8840932622fead (diff)
2003-01-18 Havoc Pennington <hp@pobox.com>
* dbus/dbus-connection.c (dbus_connection_unref): disconnect the connection if it hasn't been already. * dbus/dbus-connection.h: kill off the idea of an ErrorFunction, replace with DisconnectFunction.
Diffstat (limited to 'test')
-rw-r--r--test/watch.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/test/watch.c b/test/watch.c
index f9b8b8d9..02a1e976 100644
--- a/test/watch.c
+++ b/test/watch.c
@@ -297,16 +297,10 @@ quit_mainloop (void)
}
static void
-error_handler (DBusConnection *connection,
- DBusResultCode error_code,
- void *data)
+disconnect_handler (DBusConnection *connection,
+ void *data)
{
- fprintf (stderr,
- "Error on connection: %s\n",
- dbus_result_to_string (error_code));
-
- /* we don't want to be called again since we're dropping the connection */
- dbus_connection_set_error_function (connection, NULL, NULL, NULL);
+ fprintf (stderr, "Disconnected\n");
_dbus_list_remove (&connections, connection);
dbus_connection_unref (connection);
@@ -322,9 +316,9 @@ setup_connection (DBusConnection *connection)
connection,
NULL);
- dbus_connection_set_error_function (connection,
- error_handler,
- NULL, NULL);
+ dbus_connection_set_disconnect_function (connection,
+ disconnect_handler,
+ NULL, NULL);
dbus_connection_ref (connection);
_dbus_list_append (&connections, connection);