DBusGConnection *connection = NULL;
DBusGProxy *dbus_proxy = NULL;
+ gboolean bResult = FALSE;
g_type_init();
connection = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
if (error != NULL) {
- _DEBUG_ERROR("Connecting to system bus failed: %s\n", error->message);
+ _DEBUG_ERROR("dbus_g_bus_get failed: %s\n", error->message);
g_error_free(error);
_INNER_FUNC_EXIT;
return -1;
_DEBUG_INFO("dbus_proxy %x", dbus_proxy);
//dbus_g_proxy_call_no_reply(dbus_proxy, "Hello_Agent", G_TYPE_INVALID);
- dbus_g_proxy_call(dbus_proxy, "Hello_Agent", &error, G_TYPE_INVALID, G_TYPE_INVALID);
+ bResult = dbus_g_proxy_call(dbus_proxy, "Hello_Agent", &error, G_TYPE_INVALID, G_TYPE_INVALID);
+
+ if (bResult == FALSE) {
+ _DEBUG_ERROR("dbus_g_proxy_call failed: %s\n", error->message);
+ g_error_free(error);
+ g_object_unref(dbus_proxy);
+ dbus_g_connection_unref(connection);
+
+ _INNER_FUNC_EXIT;
+ return -1;
+ }
g_object_unref(dbus_proxy);
dbus_g_connection_unref(connection);
connection = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error);
if (error != NULL) {
- _DEBUG_ERROR("Connecting to system bus failed: %s\n", error->message);
+ _DEBUG_ERROR("dbus_g_bus_get failed: %s\n", error->message);
g_error_free(error);
_INNER_FUNC_EXIT;
return -1;