summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas/ecore_evas_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ecore_evas/ecore_evas_module.c')
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 581e0131ab..9d5e6ad075 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -20,6 +20,16 @@ static Eina_Module *_ecore_evas_vnc = NULL;
20# define ECORE_EVAS_ENGINE_NAME "module.so" 20# define ECORE_EVAS_ENGINE_NAME "module.so"
21#endif 21#endif
22 22
23static inline Eina_Bool
24_file_exists(const char *file)
25{
26 if (!file) return EINA_FALSE;
27
28 if (access(file, F_OK) == -1) return EINA_FALSE;
29 return EINA_TRUE;
30}
31
32
23static Eina_Module * 33static Eina_Module *
24_ecore_evas_vnc_server_module_try_load(const char *prefix, 34_ecore_evas_vnc_server_module_try_load(const char *prefix,
25 Eina_Bool use_prefix_only) 35 Eina_Bool use_prefix_only)
@@ -119,10 +129,9 @@ _ecore_evas_engine_load(const char *engine)
119 { 129 {
120 if (run_in_tree) 130 if (run_in_tree)
121 { 131 {
122 struct stat st;
123 snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s", 132 snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
124 path, engine, ECORE_EVAS_ENGINE_NAME); 133 path, engine, ECORE_EVAS_ENGINE_NAME);
125 if (stat(tmp, &st) != 0) 134 if (!_file_exists(tmp))
126 tmp[0] = '\0'; 135 tmp[0] = '\0';
127 } 136 }
128 } 137 }
@@ -165,9 +174,8 @@ _ecore_evas_engine_init(void)
165 { 174 {
166 if (getenv("EFL_RUN_IN_TREE")) 175 if (getenv("EFL_RUN_IN_TREE"))
167 { 176 {
168 struct stat st;
169 const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/"; 177 const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
170 if (stat(mp, &st) == 0) 178 if (_file_exists(mp))
171 { 179 {
172 _engines_paths = eina_list_append(_engines_paths, strdup(mp)); 180 _engines_paths = eina_list_append(_engines_paths, strdup(mp));
173 return; 181 return;
@@ -218,16 +226,6 @@ _ecore_evas_engine_shutdown(void)
218 eina_stringshare_del(path); 226 eina_stringshare_del(path);
219} 227}
220 228
221static Eina_Bool
222_file_exists(const char *file)
223{
224 struct stat st;
225 if (!file) return EINA_FALSE;
226
227 if (stat(file, &st) < 0) return EINA_FALSE;
228 return EINA_TRUE;
229}
230
231const Eina_List * 229const Eina_List *
232_ecore_evas_available_engines_get(void) 230_ecore_evas_available_engines_get(void)
233{ 231{