static int g_lang_ref_count;
static Ecore_Fd_Handler* g_fd_handler_lang = NULL;
-static int g_fd_lang;
-static int g_wd_lang;
+static int g_fd_lang = -1;
+static int g_wd_lang = -1;
static GList* g_ino_list = NULL;
{
SLOG(LOG_DEBUG, vc_config_tag(), "@@@ Config changed callback event");
+ if (g_fd_lang < 0) {
+ SLOG(LOG_WARN, vc_config_tag(), "[WARN] FD for config file is closed");
+ SLOG(LOG_DEBUG, vc_config_tag(), "@@@");
+ return ECORE_CALLBACK_PASS_ON;
+ }
+
int length;
struct inotify_event event;
memset(&event, '\0', sizeof(struct inotify_event));
length = read(g_fd_lang, &event, sizeof(struct inotify_event));
-
if (0 > length) {
SLOG(LOG_ERROR, vc_config_tag(), "[ERROR] Empty Inotify event");
SLOG(LOG_DEBUG, vc_config_tag(), "@@@");
inotify_rm_watch(g_fd_lang, g_wd_lang);
close(g_fd_lang);
g_fd_handler_lang = NULL;
- g_wd_lang = NULL;
- g_fd_lang = NULL;
+ g_fd_lang = -1;
vconf_ignore_key_changed(VCONFKEY_LANGSET, __vc_config_language_changed_cb);
}