From: DoHyun Pyun Date: Mon, 2 Apr 2018 09:57:53 +0000 (+0900) Subject: Remove dbus-glib-1 dependency X-Git-Tag: accepted/tizen/5.0/unified/20181102.013852^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fapi%2Fserial.git;a=commitdiff_plain;h=9f879ae7e184e2de8c94902f9b60bbf3eb436ca1 Remove dbus-glib-1 dependency Change-Id: I5bbbe316ca6bdf004f6402dbd62e761f0c295b71 Signed-off-by: DoHyun Pyun --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 68aff7a..2e30fc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(INC_DIR include) INCLUDE_DIRECTORIES(${INC_DIR}) -SET(dependents "dlog glib-2.0 capi-base-common dbus-glib-1") +SET(dependents "dlog glib-2.0 capi-base-common dbus-1") SET(pc_dependents "capi-base-common") INCLUDE(FindPkgConfig) diff --git a/include/serial_private.h b/include/serial_private.h index 2e5c88f..7c0ddf3 100644 --- a/include/serial_private.h +++ b/include/serial_private.h @@ -17,8 +17,6 @@ #ifndef __TIZEN_NETWORK_SERIAL_PRIVATE_H__ #define __TIZEN_NETWORK_SERIAL_PRIVATE_H__ -#include - #include "serial.h" #ifdef __cplusplus @@ -39,7 +37,7 @@ extern "C" { * @brief Serial handle */ typedef struct _serial_s { - DBusGConnection *client_bus; + DBusConnection *client_bus; int client_socket; int g_watch_id; serial_event_s state_handler; diff --git a/packaging/capi-network-serial.spec b/packaging/capi-network-serial.spec index 9d5d3d3..9afb92a 100644 --- a/packaging/capi-network-serial.spec +++ b/packaging/capi-network-serial.spec @@ -7,10 +7,10 @@ License: Apache-2.0 Source0: %{name}-%{version}.tar.gz Source1001: capi-network-serial.manifest -BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(dbus-1) BuildRequires: cmake 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; }