From dd410d47f6d7c835efe5b571e2333e92a4a231a4 Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Thu, 22 Mar 2018 14:14:35 +0900 Subject: [PATCH] Delete dbus flush after dbus add match Change-Id: I47ce72a8c9ae5713b28ddf0992c1f134464640b0 Signed-off-by: sooyeon.kim --- client/vc_dbus.c | 2 -- client/vc_mgr_dbus.c | 2 -- client/vc_setting_dbus.c | 3 +-- client/vc_widget_dbus.c | 18 ++++++++---------- server/vcd_dbus.c | 1 - 5 files changed, 9 insertions(+), 17 deletions(-) diff --git a/client/vc_dbus.c b/client/vc_dbus.c index 7bc8cef..cab1bcb 100644 --- a/client/vc_dbus.c +++ b/client/vc_dbus.c @@ -277,7 +277,6 @@ int vc_dbus_open_connection() /* add a rule for which messages we want to see */ dbus_bus_add_match(g_conn_listener, rule, &err); - dbus_connection_flush(g_conn_listener); if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCC, "Match Error (%s)", err.message); @@ -289,7 +288,6 @@ int vc_dbus_open_connection() /* add a rule for daemon error */ snprintf(rule, 256, "sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',type='signal',arg0='%s'", VC_SERVER_SERVICE_INTERFACE); dbus_bus_add_match(g_conn_listener, rule, &err); - dbus_connection_flush(g_conn_listener); if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCC, "Match Error (%s)", err.message); diff --git a/client/vc_mgr_dbus.c b/client/vc_mgr_dbus.c index 4d182c3..2277fa9 100644 --- a/client/vc_mgr_dbus.c +++ b/client/vc_mgr_dbus.c @@ -675,7 +675,6 @@ int vc_mgr_dbus_open_connection() /* add a rule for which messages we want to see */ dbus_bus_add_match(g_m_conn_listener, rule, &err); - dbus_connection_flush(g_m_conn_listener); if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCM, "Match Error (%s)", err.message); @@ -913,7 +912,6 @@ int vc_mgr_dbus_request_initialize(int pid, int* service_state, int* foreground, char rule_err[256] = {0, }; snprintf(rule_err, 256, "sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',type='signal',arg0='%s'", VC_SERVER_SERVICE_INTERFACE); dbus_bus_add_match(g_m_conn_listener, rule_err, &err); - dbus_connection_flush(g_m_conn_listener); if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCM, "Match Error (%s)", err.message); diff --git a/client/vc_setting_dbus.c b/client/vc_setting_dbus.c index 3da5868..1f88a64 100755 --- a/client/vc_setting_dbus.c +++ b/client/vc_setting_dbus.c @@ -183,7 +183,6 @@ int vc_setting_dbus_open_connection() /* add a rule for which messages we want to see */ dbus_bus_add_match(g_s_conn_listener, rule, &err); - dbus_connection_flush(g_s_conn_listener); if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCS, "Match Error (%s)", err.message); @@ -376,4 +375,4 @@ int vc_setting_dbus_request_set_language(int pid, const char* language) } return result; -} \ No newline at end of file +} diff --git a/client/vc_widget_dbus.c b/client/vc_widget_dbus.c index db68c92..6883ad0 100644 --- a/client/vc_widget_dbus.c +++ b/client/vc_widget_dbus.c @@ -270,7 +270,7 @@ static Eina_Bool widget_listener_event_callback(void* data, Ecore_Fd_Handler *fd return ECORE_CALLBACK_PASS_ON; } -static void __vc_mgr_dbus_connection_free() +static void __vc_widget_dbus_connection_free() { if (NULL != g_w_conn_listener) { dbus_connection_close(g_w_conn_listener); @@ -321,7 +321,7 @@ int vc_widget_dbus_open_connection() if (NULL == g_w_conn_listener) { SLOG(LOG_ERROR, TAG_VCW, "Fail to get dbus connection "); - __vc_mgr_dbus_connection_free(); + __vc_widget_dbus_connection_free(); return VC_ERROR_OPERATION_FAILED; } @@ -345,13 +345,13 @@ int vc_widget_dbus_open_connection() if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) { SLOG(LOG_ERROR, TAG_VCW, "fail dbus_bus_request_name()"); - __vc_mgr_dbus_connection_free(); + __vc_widget_dbus_connection_free(); return -2; } if (NULL != g_w_fd_handler) { SLOG(LOG_WARN, TAG_VCW, "The handler already exists."); - __vc_mgr_dbus_connection_free(); + __vc_widget_dbus_connection_free(); return 0; } @@ -360,19 +360,18 @@ int vc_widget_dbus_open_connection() /* add a rule for which messages we want to see */ dbus_bus_add_match(g_w_conn_listener, rule, &err); - dbus_connection_flush(g_w_conn_listener); if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCW, "Match Error (%s)", err.message); dbus_error_free(&err); - __vc_mgr_dbus_connection_free(); + __vc_widget_dbus_connection_free(); return VC_ERROR_OPERATION_FAILED; } int fd = 0; if (1 != dbus_connection_get_unix_fd(g_w_conn_listener, &fd)) { SLOG(LOG_ERROR, TAG_VCW, "fail to get fd from dbus "); - __vc_mgr_dbus_connection_free(); + __vc_widget_dbus_connection_free(); return VC_ERROR_OPERATION_FAILED; } else { SLOG(LOG_DEBUG, TAG_VCW, "Get fd from dbus : %d", fd); @@ -382,7 +381,7 @@ int vc_widget_dbus_open_connection() if (NULL == g_w_fd_handler) { SLOG(LOG_ERROR, TAG_VCW, "fail to get fd handler from ecore "); - __vc_mgr_dbus_connection_free(); + __vc_widget_dbus_connection_free(); return VC_ERROR_OPERATION_FAILED; } @@ -414,7 +413,7 @@ int vc_widget_dbus_close_connection() } } - __vc_mgr_dbus_connection_free(); + __vc_widget_dbus_connection_free(); return 0; } @@ -571,7 +570,6 @@ int vc_widget_dbus_request_initialize(int pid, int* service_state, int* daemon_p char rule_err[256] = {0, }; snprintf(rule_err, 256, "sender='org.freedesktop.DBus',path='/org/freedesktop/DBus',interface='org.freedesktop.DBus',member='NameOwnerChanged',type='signal',arg0='%s'", VC_SERVER_SERVICE_INTERFACE); dbus_bus_add_match(g_w_conn_listener, rule_err, &err); - dbus_connection_flush(g_w_conn_listener); if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCW, "Match Error (%s)", err.message); diff --git a/server/vcd_dbus.c b/server/vcd_dbus.c index fec9af1..5d37055 100755 --- a/server/vcd_dbus.c +++ b/server/vcd_dbus.c @@ -1107,7 +1107,6 @@ int vcd_dbus_open_connection() /* add a rule for which messages we want to see */ dbus_bus_add_match(g_conn_listener, rule, &err);/* see signals from the given interface */ - dbus_connection_flush(g_conn_listener); if (dbus_error_is_set(&err)) { SLOG(LOG_ERROR, TAG_VCD, "[Dbus ERROR] dbus_bus_add_match() : %s", err.message); -- 2.7.4