X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fapi%2Fserial.git;a=blobdiff_plain;f=src%2Fserial.c;h=7c5d783ef9c52ed051a7f249968c931347f362bb;hp=1772bccfa7842501c75410241a027a9f7d4b747f;hb=HEAD;hpb=e3f424e3dbf8df1e567f200e7eeca8c0a43184cc diff --git a/src/serial.c b/src/serial.c index 1772bcc..7c5d783 100644 --- a/src/serial.c +++ b/src/serial.c @@ -21,8 +21,6 @@ #include #include #include -#include -#include #include #include #include @@ -231,7 +229,6 @@ int serial_create(serial_h * serial) { DBG("%s\n", __FUNCTION__); - GError *error = NULL; DBusError dbus_error; serial_s *pHandle = NULL; @@ -245,14 +242,12 @@ int serial_create(serial_h * serial) g_type_init(); #endif - pHandle->client_bus = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); - if (error) { - ERR("Couldn't connect to the System bus[%s]", error->message); - g_error_free(error); + dbus_connection = dbus_bus_get(DBUS_BUS_SYSTEM, NULL); + if (!dbus_connection) { + ERR("Couldn't connect to the System bus"); g_free(pHandle); return SERIAL_ERROR_OPERATION_FAILED; } - dbus_connection = dbus_g_connection_get_connection(pHandle->client_bus); /* Add the filter for network client functions */ dbus_error_init(&dbus_error); @@ -265,6 +260,8 @@ int serial_create(serial_h * serial) return SERIAL_ERROR_OPERATION_FAILED; } + pHandle->client_bus = dbus_connection; + *serial = (serial_h) pHandle; return SERIAL_ERROR_NONE; @@ -322,7 +319,7 @@ int serial_destroy(serial_h serial) } if (pHandle->client_bus != NULL) { - dbus_g_connection_unref(pHandle->client_bus); + dbus_connection_unref(pHandle->client_bus); pHandle->client_bus = NULL; }