Add to check RW config file and reset config info
[platform/core/uifw/tts.git] / common / tts_config_mgr.c
index 21ccd8a..1522950 100644 (file)
@@ -495,9 +495,11 @@ Eina_Bool tts_config_mgr_inotify_event_cb(void* data, Ecore_Fd_Handler *fd_handl
                        free(lang);
                        lang = NULL;
                }
-       } else if (IN_IGNORED == event.mask) {
-               SLOG(LOG_ERROR, tts_tag(), "[ERROR] IN_IGNORED event");
+       } else if (IN_DELETE_SELF == event.mask) {
+               SLOG(LOG_ERROR, tts_tag(), "[ERROR] IN_DELETE_SELF event");
+
                tts_parser_unload_config(g_config_info);
+               tts_parser_reset();
                tts_parser_load_config(&g_config_info);
        } else {
                SLOG(LOG_ERROR, tts_tag(), "[ERROR] Undefined event (0x%x)", event.mask);
@@ -521,7 +523,7 @@ int __tts_config_mgr_register_config_event()
        }
        g_config_fd_noti = fd;
 
-       wd = inotify_add_watch(fd, TTS_CONFIG, IN_CLOSE_WRITE);
+       wd = inotify_add_watch(fd, TTS_CONFIG, IN_CLOSE_WRITE|IN_DELETE_SELF);
        g_config_wd_noti = wd;
 
        g_config_fd_handler_noti = ecore_main_fd_handler_add(fd, ECORE_FD_READ,