eina_module: Raise dlopen() error messages to WRN when file exists

Failing to load a module that does not exist is indeed not an error,
but failing to load a module that exists on disk happened probably
because of an error like "symbol not found".

Considering eina_module is most likely used by EFL itself, I believe
an internal linking failure is a warning worth reporting.
This commit is contained in:
Jean-Philippe Andre 2015-07-13 14:08:08 +09:00
parent 576f2ccab7
commit c7e0c1b340
1 changed files with 7 additions and 2 deletions

View File

@ -330,8 +330,13 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m)
if (!dl_handle) if (!dl_handle)
{ {
DBG("could not dlopen(\"%s\", %s): %s", m->file, dlerror(), struct stat st;
(flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY"); if (!stat(m->file, &st))
WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(),
(flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY");
else
DBG("could not dlopen(\"%s\", %s): %s", m->file, dlerror(),
(flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY");
return EINA_FALSE; return EINA_FALSE;
} }