Delete dbus flush after dbus add match
authorsooyeon.kim <sooyeon.kim@samsung.com>
Thu, 22 Mar 2018 05:14:35 +0000 (14:14 +0900)
committersooyeon.kim <sooyeon.kim@samsung.com>
Mon, 26 Mar 2018 12:46:38 +0000 (21:46 +0900)
Change-Id: I47ce72a8c9ae5713b28ddf0992c1f134464640b0
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
client/vc_dbus.c
client/vc_mgr_dbus.c
client/vc_setting_dbus.c
client/vc_widget_dbus.c
server/vcd_dbus.c

index 7bc8cef..cab1bcb 100644 (file)
@@ -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);
index 4d182c3..2277fa9 100644 (file)
@@ -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);
index 3da5868..1f88a64 100755 (executable)
@@ -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
+}
index db68c92..6883ad0 100644 (file)
@@ -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);
index fec9af1..5d37055 100755 (executable)
@@ -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);