From 06a3b13134e29b75971970aa45ba14576a4f6ced Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 10 Aug 2009 16:58:31 -0400 Subject: Change services identification mechanism Let services identify themselves voiluntarily as the first operation instead of polling from the monitor. Also consolidate some common functions and make them available as monitor helpers. --- server/sbus/sssd_dbus_connection.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server/sbus') diff --git a/server/sbus/sssd_dbus_connection.c b/server/sbus/sssd_dbus_connection.c index ab414da05..396a1f27f 100644 --- a/server/sbus/sssd_dbus_connection.c +++ b/server/sbus/sssd_dbus_connection.c @@ -111,7 +111,8 @@ static void sbus_conn_wakeup_main(void *data) struct tevent_timer *te; conn = talloc_get_type(data, struct sbus_connection); - gettimeofday(&tv, NULL); + + tv = tevent_timeval_current(); /* D-BUS calls this function when it is time to do a dispatch */ te = tevent_add_timer(conn->ev, conn, tv, sbus_dispatch, conn); @@ -147,13 +148,13 @@ int sbus_init_connection(TALLOC_CTX *ctx, conn->dbus.conn = dbus_conn; conn->connection_type = connection_type; - ret = sbus_conn_set_fns(conn); + ret = sbus_conn_add_interface(conn, intf); if (ret != EOK) { talloc_free(conn); return ret; } - ret = sbus_conn_add_interface(conn, intf); + ret = sbus_conn_set_fns(conn); if (ret != EOK) { talloc_free(conn); return ret; -- cgit