From a7c0fb33281ba9b129003aeea40f67dcbc4be3ac Mon Sep 17 00:00:00 2001 From: Forrest Zhao Date: Wed, 27 Jan 2010 15:26:39 +0800 Subject: [PATCH] obexd: Introduce obex_dbus_get_connection() to obexd server so that session DBusConnection is retrieved by obex_dbus_get_connection() at obexd server side --- obexd/plugins/syncevolution.c | 2 +- obexd/src/manager.c | 6 ++++++ obexd/src/obexd.h | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/obexd/plugins/syncevolution.c b/obexd/plugins/syncevolution.c index 05f5cced6..711b5a010 100644 --- a/obexd/plugins/syncevolution.c +++ b/obexd/plugins/syncevolution.c @@ -269,7 +269,7 @@ static void synce_connect(obex_t *obex, obex_object_t *obj) struct callback_data *cb_data; struct synce_context *context; - conn = dbus_bus_get(DBUS_BUS_SESSION, NULL); + conn = obex_dbus_get_connection(); if (!conn) goto failed; diff --git a/obexd/src/manager.c b/obexd/src/manager.c index be0af447d..e1778e1b9 100644 --- a/obexd/src/manager.c +++ b/obexd/src/manager.c @@ -1028,4 +1028,10 @@ void unregister_session(guint32 id) g_free(path); } +DBusConnection *obex_dbus_get_connection(void) +{ + if (connection == NULL) + return NULL; + return dbus_connection_ref(connection); +} diff --git a/obexd/src/obexd.h b/obexd/src/obexd.h index e69872d34..94ec7955c 100644 --- a/obexd/src/obexd.h +++ b/obexd/src/obexd.h @@ -21,6 +21,8 @@ * */ +#include + #define OPENOBEX_SERVICE "org.openobex" #define OPENOBEX_MANAGER_PATH "/" @@ -34,3 +36,5 @@ void manager_cleanup(void); gboolean plugin_init(void); void plugin_cleanup(void); + +DBusConnection *obex_dbus_get_connection(void); -- 2.47.3