Add to set false as exit when dbus disconnects 78/156778/1
authorWonnam Jang <wn.jang@samsung.com>
Fri, 20 Oct 2017 02:01:13 +0000 (11:01 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Fri, 20 Oct 2017 02:01:13 +0000 (11:01 +0900)
Change-Id: Ib03b4bf2dcf61da92ced91c325167585324c5708
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
client/stt_dbus.c
server/sttd_dbus.c

index e616520..97b726b 100644 (file)
@@ -703,6 +703,8 @@ int stt_dbus_open_connection()
                return STT_ERROR_OPERATION_FAILED;
        }
 
+       dbus_connection_set_exit_on_disconnect(g_conn_listener, false);
+
        int pid = getpid();
 
        char service_name[64];
index 28298be..cf69d02 100644 (file)
@@ -652,6 +652,13 @@ int __sttd_request_custom_dbus_name()
                return STTD_ERROR_OPERATION_FAILED;
        }
 
+       if (NULL == g_conn_custom) {
+               SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to get dbus connection");
+               return STT_ERROR_OPERATION_FAILED;
+       }
+
+       dbus_connection_set_exit_on_disconnect(g_conn_custom, false);
+
        int ret = dbus_bus_request_name(g_conn_custom, STT_SERVER_CUSTOM_SERVICE_NAME, DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
        if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) {
                SLOG(LOG_ERROR, TAG_STTD, "[Dbus ERROR] Fail to be primary owner");
@@ -700,6 +707,8 @@ int sttd_dbus_open_connection()
                return STTD_ERROR_OPERATION_FAILED;
        }
 
+       dbus_connection_set_exit_on_disconnect(g_conn_sender, false);
+
        /* connect to the bus and check for errors */
        g_conn_listener = dbus_bus_get_private(DBUS_BUS_SESSION, &err);
 
@@ -714,6 +723,8 @@ int sttd_dbus_open_connection()
                return STTD_ERROR_OPERATION_FAILED;
        }
 
+       dbus_connection_set_exit_on_disconnect(g_conn_listener, false);
+
        /* Get buxton key */
        ret = __sttd_get_buxtonkey();
        if (0 != ret) {