Add to check RW config file and reset config info
[platform/core/uifw/tts.git] / common / tts_config_mgr.c
index ba26a96..1522950 100644 (file)
@@ -495,8 +495,14 @@ Eina_Bool tts_config_mgr_inotify_event_cb(void* data, Ecore_Fd_Handler *fd_handl
                        free(lang);
                        lang = NULL;
                }
+       } 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");
+               SLOG(LOG_ERROR, tts_tag(), "[ERROR] Undefined event (0x%x)", event.mask);
        }
 
        SLOG(LOG_DEBUG, tts_tag(), "@@@");
@@ -517,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,