summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-02 19:20:04 +0900
committerAmitesh Singh <amitesh.sh@samsung.com>2015-09-02 17:25:13 +0530
commit7e00a3da1092a4798cfabe2ef0b4f19346d8cd4c (patch)
treeffd6a8a7386fc119a00879992112f53b88fcf736
parent071c91dde45d766b1ab22632bd64cc010fd4c5bc (diff)
downloadelementary-7e00a3da1092a4798cfabe2ef0b4f19346d8cd4c.tar.gz
elm map - fix module load craziness loading all elm modules
so elm map loads every module it can find in a recursive dir walk of all elm modules. this si nuts. this can accidentallly load OLD modules and thats a recipe for disaster. so check module arch dir aagainst module arch string to load the right version and be quiet if module doesn thave the right symbols - it's the wrong module type. @fix
-rw-r--r--src/lib/elm_map.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c
index b799c7e93..8a3101894 100644
--- a/src/lib/elm_map.c
+++ b/src/lib/elm_map.c
@@ -3451,6 +3451,8 @@ _source_mod_cb(Eina_Module *m,
{
const char *file;
Elm_Map_Data *sd = data;
+ char *dir;
+ const char *subfile;
Elm_Map_Module_Source_Name_Func name_cb;
Elm_Map_Module_Tile_Url_Func tile_url_cb;
@@ -3465,17 +3467,28 @@ _source_mod_cb(Eina_Module *m,
EINA_SAFETY_ON_NULL_RETURN_VAL(data, EINA_FALSE);
file = eina_module_file_get(m);
- if (!eina_module_load(m))
+ if (!file) return EINA_FALSE;
+
+ dir = ecore_file_dir_get(file);
+ if (!dir) return EINA_FALSE;
+ subfile = ecore_file_file_get(dir);
+ if (!subfile)
+ {
+ free(dir);
+ return EINA_FALSE;
+ }
+ if (strcmp(subfile, MODULE_ARCH))
{
- ERR("Could not load module \"%s\": %s", file,
- eina_error_msg_get(eina_error_get()));
+ free(dir);
return EINA_FALSE;
}
+ free(dir);
+
+ if (!eina_module_load(m)) return EINA_FALSE;
+
name_cb = eina_module_symbol_get(m, "map_module_source_name_get");
if ((!name_cb))
{
- WRN("Could not find map module name from module \"%s\": %s",
- file, eina_error_msg_get(eina_error_get()));
eina_module_unload(m);
return EINA_FALSE;
}