From 7778a48e169d5cc095c3dde4c99e5412b918513a Mon Sep 17 00:00:00 2001 From: Mok Jeongho Date: Thu, 17 Mar 2016 21:56:44 +0900 Subject: [PATCH] Print error message when g_bus_get_sync failed [Version] Release 0.10.16 [Profile] Common [Issue Type] Code Enhancement Change-Id: I9253ed4e69659213a09874171b5f95aa5e871f1d --- common/mm_sound_dbus.c | 11 +++++++++-- packaging/libmm-sound.spec | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/common/mm_sound_dbus.c b/common/mm_sound_dbus.c index 04b3892..c2b9f15 100644 --- a/common/mm_sound_dbus.c +++ b/common/mm_sound_dbus.c @@ -331,13 +331,17 @@ static GDBusConnection* _dbus_get_connection(GBusType bustype) { static GDBusConnection *conn_system = NULL; static GDBusConnection *conn_session = NULL; + GError *err = NULL; if (bustype == G_BUS_TYPE_SYSTEM) { if (conn_system) { debug_log("Already connected to system bus"); } else { debug_log("Get new connection on system bus"); - conn_system = g_bus_get_sync(bustype, NULL, NULL); + if (!(conn_system = g_bus_get_sync(bustype, NULL, &err))) { + debug_error ("g_dbus_get_sync() error (%s)", err->message); + g_error_free(err); + } } return conn_system; } else if (bustype == G_BUS_TYPE_SESSION) { @@ -345,7 +349,10 @@ static GDBusConnection* _dbus_get_connection(GBusType bustype) debug_log("Already connected to session bus"); } else { debug_log("Get new connection on session bus"); - conn_session = g_bus_get_sync(bustype, NULL, NULL); + if (!(conn_session = g_bus_get_sync(bustype, NULL, &err))) { + debug_error ("g_dbus_get_sync() error (%s)", err->message); + g_error_free(err); + } } return conn_session; } else { diff --git a/packaging/libmm-sound.spec b/packaging/libmm-sound.spec index b6c807b..b72f980 100644 --- a/packaging/libmm-sound.spec +++ b/packaging/libmm-sound.spec @@ -1,6 +1,6 @@ Name: libmm-sound Summary: MMSound Package contains client lib and sound_server binary -Version: 0.10.15 +Version: 0.10.16 Release: 0 Group: System/Libraries License: Apache-2.0 -- 2.7.4