aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore_evas/ecore_evas_module.c
diff options
context:
space:
mode:
authorLauro Moura <lauromoura@expertisesolutions.com.br>2017-11-23 15:30:58 -0800
committerCedric Bail <cedric@osg.samsung.com>2017-11-23 15:31:01 -0800
commit3afbcb2e27e158d8b4758e82a5c25b98458fea7d (patch)
tree6035bc98aeaae5f64f4479745e85f368dc484d80 /src/lib/ecore_evas/ecore_evas_module.c
parentelementary: fix compilation of elm_code test on windows (diff)
downloadefl-3afbcb2e27e158d8b4758e82a5c25b98458fea7d.tar.gz
ecore_evas: use access() instead of stat()
Summary: stat() wasn't working on Windows due to some msys2/mingw quirk. Reviewers: felipealmeida, cedric, vtorri Subscribers: jenkins, jpeg Tags: #windows Differential Revision: https://phab.enlightenment.org/D5520 Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
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;
# define ECORE_EVAS_ENGINE_NAME "module.so"
#endif
+static inline Eina_Bool
+_file_exists(const char *file)
+{
+ if (!file) return EINA_FALSE;
+
+ if (access(file, F_OK) == -1) return EINA_FALSE;
+ return EINA_TRUE;
+}
+
+
static Eina_Module *
_ecore_evas_vnc_server_module_try_load(const char *prefix,
Eina_Bool use_prefix_only)
@@ -119,10 +129,9 @@ _ecore_evas_engine_load(const char *engine)
{
if (run_in_tree)
{
- struct stat st;
snprintf(tmp, sizeof(tmp), "%s/%s/.libs/%s",
path, engine, ECORE_EVAS_ENGINE_NAME);
- if (stat(tmp, &st) != 0)
+ if (!_file_exists(tmp))
tmp[0] = '\0';
}
}
@@ -165,9 +174,8 @@ _ecore_evas_engine_init(void)
{
if (getenv("EFL_RUN_IN_TREE"))
{
- struct stat st;
const char mp[] = PACKAGE_BUILD_DIR"/src/modules/ecore_evas/engines/";
- if (stat(mp, &st) == 0)
+ if (_file_exists(mp))
{
_engines_paths = eina_list_append(_engines_paths, strdup(mp));
return;
@@ -218,16 +226,6 @@ _ecore_evas_engine_shutdown(void)
eina_stringshare_del(path);
}
-static Eina_Bool
-_file_exists(const char *file)
-{
- struct stat st;
- if (!file) return EINA_FALSE;
-
- if (stat(file, &st) < 0) return EINA_FALSE;
- return EINA_TRUE;
-}
-
const Eina_List *
_ecore_evas_available_engines_get(void)
{