summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHyunho Kang <hhstark.kang@samsung.com>2016-04-05 14:18:56 +0900
committerHyunho Kang <hhstark.kang@samsung.com>2016-04-05 14:19:47 +0900
commitd128fd8aeda44569cc18596235e78d4533470c7a (patch)
tree1706ea302a34d98628625b20f01614a741e9b896 /src
parent5bb3cd950915749ef72f6c4221c446abd8e64aec (diff)
downloadnotification-d128fd8aeda44569cc18596235e78d4533470c7a.tar.gz
notification-d128fd8aeda44569cc18596235e78d4533470c7a.tar.bz2
notification-d128fd8aeda44569cc18596235e78d4533470c7a.zip
Change-Id: Ib49ec6068e92813e2c4bdd1f86652665832fc5fd Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/notification_ipc.c61
1 files changed, 34 insertions, 27 deletions
diff --git a/src/notification_ipc.c b/src/notification_ipc.c
index 4ce6465..4f6edc3 100755
--- a/src/notification_ipc.c
+++ b/src/notification_ipc.c
@@ -101,12 +101,44 @@ static inline char *_string_get(char *string)
return string;
}
+static int _dbus_init()
+{
+ int ret = NOTIFICATION_ERROR_NONE;
+ GError *error = NULL;
+
+ if (_gdbus_conn == NULL) {
+ _gdbus_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
+
+ if (_gdbus_conn == NULL) {
+ if (error != NULL) {
+ NOTIFICATION_ERR("Failed to get dbus [%s]", error->message);
+ g_error_free(error);
+ }
+ return NOTIFICATION_ERROR_IO_ERROR;
+ }
+ _bus_name = g_dbus_connection_get_unique_name(_gdbus_conn);
+ NOTIFICATION_DBG("bus name : %s", _bus_name);
+
+ notification_error_quark();
+
+ ret = NOTIFICATION_ERROR_NONE;
+ }
+ return ret;
+}
int notification_ipc_is_master_ready(void)
{
GVariant *result;
GError *err = NULL;
gboolean name_exist;
+ int ret = NOTIFICATION_ERROR_NONE;
+
+ ret = _dbus_init();
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ NOTIFICATION_ERR("Can't init dbus %d", result);
+ is_master_started = 0;
+ return is_master_started;
+ }
result = g_dbus_connection_call_sync(
_gdbus_conn,
@@ -123,9 +155,10 @@ int notification_ipc_is_master_ready(void)
if (err || (result == NULL)) {
if (err) {
- NOTIFICATION_ERR("No reply. error = %s", err->message);
+ NOTIFICATION_ERR("No reply. error = %s", err->message);
g_error_free(err);
}
+ NOTIFICATION_ERR("is master ready fail");
is_master_started = 0;
} else {
g_variant_get(result, "(b)", &name_exist);
@@ -468,32 +501,6 @@ static int _dbus_signal_init()
return ret;
}
-
-static int _dbus_init()
-{
- int ret = NOTIFICATION_ERROR_NONE;
- GError *error = NULL;
-
- if (_gdbus_conn == NULL) {
- _gdbus_conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
-
- if (_gdbus_conn == NULL) {
- if (error != NULL) {
- NOTIFICATION_ERR("Failed to get dbus [%s]", error->message);
- g_error_free(error);
- }
- return NOTIFICATION_ERROR_IO_ERROR;
- }
- _bus_name = g_dbus_connection_get_unique_name(_gdbus_conn);
- NOTIFICATION_DBG("bus name : %s", _bus_name);
-
- notification_error_quark();
-
- ret = NOTIFICATION_ERROR_NONE;
- }
- return ret;
-}
-
static int _send_sync_noti(GVariant *body, GDBusMessage **reply, char *cmd)
{
int ret = NOTIFICATION_ERROR_NONE;