From 5c1c30cd6d5e22aeca4c5c633af3e9f2b9e86ecc Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 1 Jul 2014 16:31:10 +0900 Subject: [PATCH] fix eio moniotr complaint on non-existing dirs --- src/bin/e_module.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/bin/e_module.c b/src/bin/e_module.c index f91810a4b..402ecc35c 100644 --- a/src/bin/e_module.c +++ b/src/bin/e_module.c @@ -159,24 +159,30 @@ e_module_init(void) if (mod_src_path) { - mon = eio_monitor_stringshared_add(mod_src_path); - ls = eio_file_direct_ls(mod_src_path, _module_filter_cb, _module_main_cb, _module_done_cb, _module_error_cb, NULL); - _e_module_path_monitors = eina_list_append(_e_module_path_monitors, mon); - _e_module_path_lists = eina_list_append(_e_module_path_lists, ls); - return 1; + if (ecore_file_is_dir(mod_src_path)) + { + mon = eio_monitor_stringshared_add(mod_src_path); + ls = eio_file_direct_ls(mod_src_path, _module_filter_cb, _module_main_cb, _module_done_cb, _module_error_cb, NULL); + _e_module_path_monitors = eina_list_append(_e_module_path_monitors, mon); + _e_module_path_lists = eina_list_append(_e_module_path_lists, ls); + return 1; + } } module_paths = e_path_dir_list_get(path_modules); EINA_LIST_FREE(module_paths, epd) { - void *data = NULL; + if (ecore_file_is_dir(epd->dir)) + { + void *data = NULL; - mon = eio_monitor_stringshared_add(epd->dir); - data = (intptr_t*)(long)!!strstr(epd->dir, e_user_dir_get()); - ls = eio_file_direct_ls(epd->dir, _module_filter_cb, _module_main_cb, _module_done_cb, _module_error_cb, data); - _e_module_path_monitors = eina_list_append(_e_module_path_monitors, mon); - _e_module_path_lists = eina_list_append(_e_module_path_lists, ls); - eina_stringshare_del(epd->dir); - free(epd); + mon = eio_monitor_stringshared_add(epd->dir); + data = (intptr_t*)(long)!!strstr(epd->dir, e_user_dir_get()); + ls = eio_file_direct_ls(epd->dir, _module_filter_cb, _module_main_cb, _module_done_cb, _module_error_cb, data); + _e_module_path_monitors = eina_list_append(_e_module_path_monitors, mon); + _e_module_path_lists = eina_list_append(_e_module_path_lists, ls); + eina_stringshare_del(epd->dir); + free(epd); + } } return 1;