Summary:
I got an issue from emotion_basic_example, because my machine has following directories.
/usr/local/lib/emotion/modules/
├── gstreamer
│ ├── linux-gnu-i686-1.7.99
│ ├── linux-gnu-i686-1.8.0
│ └── linux-gnu-i686-1.8.99
└── gstreamer1
├── linux-gnu-i686-1.8.99
└── v-1.10
The defined MODULE_ARCH is v-1.10, and the _emotion_modules which is returned by eina_module_arch_list_get(); has two items.
Because eina_module_new(); creates Eina_Module, even though the "/usr/local/lib/emotion/modules/gstreamer/v-1.10/module.so"
does not exist.
Test Plan: Create directory without MODULE_ARCH, run emotion_basic_example, and check whether it works properly or not.
Reviewers: raster, seoz, Hermet, woohyun, jpeg, cedric
Subscribers: cedric, seoz
Differential Revision: https://phab.enlightenment.org/D1200
Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
size_t len;
EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL);
- /* TODO check that the file exists. Update doc too */
+
+ /* check that the file exists. */
+ if (access(file, F_OK)) return NULL;
len = strlen(file);
EINA_SAFETY_ON_FALSE_RETURN_VAL(len > 0, NULL);
* @brief Return a new module.
*
* @param file The name of the file module to load.
- * @return A new module. If @p file is @c NULL, the function
- * returns @c NULL, otherwise, it allocates an Eina_Module, stores
- * a duplicate string of @p file, sets its reference to @c 0 and
+ * @return A new module. If @p file is @c NULL, or if it does not exist,
+ * the function returns @c NULL, otherwise, it allocates an Eina_Module,
+ * stores a duplicate string of @p file, sets its reference to @c 0 and
* its handle to @c NULL.
*
* When the new module is not needed anymore, use eina_module_free()