summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-08-08 20:18:08 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-08-08 20:18:08 +0900
commitfb3159c48eaca7589b5e38a30b60ea12e8f41f2e (patch)
treeccd862e80397de299f55b7383a32037103568378
parent464c58a1c99d49927f14ed0e5ca2811f4401542c (diff)
eina module - minor addition ot allowing lazy loading if env var set
-rw-r--r--src/lib/eina/eina_module.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c
index 7731b3dc06..9289f71607 100644
--- a/src/lib/eina/eina_module.c
+++ b/src/lib/eina/eina_module.c
@@ -306,6 +306,7 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m)
306#ifdef HAVE_DLOPEN 306#ifdef HAVE_DLOPEN
307 void *dl_handle; 307 void *dl_handle;
308 Eina_Module_Init *initcall; 308 Eina_Module_Init *initcall;
309 int flag = RTLD_NOW;
309 310
310 EINA_SAFETY_ON_NULL_RETURN_VAL(m, EINA_FALSE); 311 EINA_SAFETY_ON_NULL_RETURN_VAL(m, EINA_FALSE);
311 312
@@ -314,10 +315,12 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m)
314 if (m->handle) 315 if (m->handle)
315 goto loaded; 316 goto loaded;
316 317
317 dl_handle = dlopen(m->file, RTLD_NOW); 318 if (getenv("EINA_MODULE_LAZY_LOAD")) flag = RTLD_LAZY;
319 dl_handle = dlopen(m->file, flag);
318 if (!dl_handle) 320 if (!dl_handle)
319 { 321 {
320 WRN("could not dlopen(\"%s\", RTLD_NOW): %s", m->file, dlerror()); 322 WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(),
323 (flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY");
321 eina_error_set(EINA_ERROR_WRONG_MODULE); 324 eina_error_set(EINA_ERROR_WRONG_MODULE);
322 return EINA_FALSE; 325 return EINA_FALSE;
323 } 326 }