From c7e0c1b3400e788e4b09435b1a83a7513cb119f0 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Mon, 13 Jul 2015 14:08:08 +0900 Subject: [PATCH] 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. --- src/lib/eina/eina_module.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c index 7c421e3..1c2075a 100644 --- a/src/lib/eina/eina_module.c +++ b/src/lib/eina/eina_module.c @@ -330,8 +330,13 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m) if (!dl_handle) { - DBG("could not dlopen(\"%s\", %s): %s", m->file, dlerror(), - (flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY"); + struct stat st; + 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; } -- 2.7.4