return 0;
}
-int __connman_agent_init(DBusConnection *conn)
+int __connman_agent_init(void)
{
- DBG("conn %p", conn);
+ DBG("");
- connection = dbus_connection_ref(conn);
+ connection = connman_dbus_get_connection();
if (connection == NULL)
return -1;
{
DBusMessage *msg;
- DBG("conn %p", connection);
+ DBG("");
+
+ if (connection == NULL)
+ return;
if (agent_watch > 0)
g_dbus_remove_watch(connection, agent_watch);
#include <connman/types.h>
-int __connman_manager_init(DBusConnection *conn, gboolean compat);
+int __connman_manager_init(gboolean compat);
void __connman_manager_cleanup(void);
-int __connman_agent_init(DBusConnection *conn);
+int __connman_agent_init(void);
void __connman_agent_cleanup(void);
int __connman_agent_register(const char *sender, const char *path);
#include <connman/element.h>
-int __connman_element_init(DBusConnection *conn, const char *device,
- const char *nodevice);
+int __connman_element_init(const char *device, const char *nodevice);
void __connman_element_start(void);
void __connman_element_stop(void);
void __connman_element_cleanup(void);
#include <connman/profile.h>
-int __connman_profile_init(DBusConnection *conn);
+int __connman_profile_init();
void __connman_profile_cleanup(void);
connman_bool_t __connman_profile_get_offlinemode(void);
__connman_service_indicate_error(service, convert_error(error));
}
-int __connman_element_init(DBusConnection *conn, const char *device,
- const char *nodevice)
+int __connman_element_init(const char *device, const char *nodevice)
{
struct connman_element *element;
- DBG("conn %p", conn);
+ DBG("");
- connection = dbus_connection_ref(conn);
+ connection = connman_dbus_get_connection();
if (connection == NULL)
return -EIO;
g_free(device_filter);
+ if (connection == NULL)
+ return;
+
dbus_connection_unref(connection);
}
__connman_dbus_init(conn);
__connman_storage_init();
- __connman_element_init(conn, option_device, option_nodevice);
+ __connman_element_init(option_device, option_nodevice);
- __connman_agent_init(conn);
- __connman_manager_init(conn, option_compat);
- __connman_profile_init(conn);
+ __connman_agent_init();
+ __connman_manager_init(option_compat);
+ __connman_profile_init();
__connman_resolver_init();
__connman_ipconfig_init();
static gboolean nm_compat = FALSE;
-int __connman_manager_init(DBusConnection *conn, gboolean compat)
+int __connman_manager_init(gboolean compat)
{
- DBG("conn %p", conn);
+ DBG("");
- connection = dbus_connection_ref(conn);
+ connection = connman_dbus_get_connection();
if (connection == NULL)
return -1;
void __connman_manager_cleanup(void)
{
- DBG("conn %p", connection);
+ DBG("");
connman_notifier_unregister(&technology_notifier);
+ if (connection == NULL)
+ return;
+
if (nm_compat == TRUE) {
g_dbus_unregister_interface(connection, NM_PATH, NM_INTERFACE);
}
.profile_save = profile_save,
};
-int __connman_profile_init(DBusConnection *conn)
+int __connman_profile_init(void)
{
- DBG("conn %p", conn);
+ DBG("");
- connection = dbus_connection_ref(conn);
+ connection = connman_dbus_get_connection();
if (connection == NULL)
return -1;
void __connman_profile_cleanup(void)
{
- DBG("conn %p", connection);
+ DBG("");
if (profiles != NULL) {
g_hash_table_destroy(profiles);