diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-25 16:14:00 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-25 16:14:00 +0000 |
commit | e5a4e12aaca0f39b1f6e2b4612a3b51f7c4363e3 (patch) | |
tree | aaca28ed5788504e420600855516f7ca89195a5d | |
parent | ec3542e02f1b13d8f9179bf1aba14070d9183f86 (diff) |
instead of reverting this supposedly 'stupid' change, let's try to get it working properly
also eliminate a warning from dlopen() because some flags were missing on the second dlopen() call
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@41087 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/loader.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/main/loader.c b/main/loader.c index 681f5ed34..4ece4ae6b 100644 --- a/main/loader.c +++ b/main/loader.c @@ -387,6 +387,14 @@ static struct ast_module *load_dynamic_module(const char *resource_in, unsigned on the already-opened library to what we want... if not, we have to close it and start over */ +#if HAVE_RTLD_NOLOAD + if (!dlopen(fn, RTLD_NOLOAD | (wants_global ? RTLD_LAZY | RTLD_GLOBAL : RTLD_NOW | RTLD_LOCAL))) { + ast_log(LOG_WARNING, "%s\n", dlerror()); + while (!dlclose(lib)); + free(resource_being_loaded); + return NULL; + } +#else while (!dlclose(lib)); resource_being_loaded = NULL; @@ -406,6 +414,7 @@ static struct ast_module *load_dynamic_module(const char *resource_in, unsigned /* since the module was successfully opened, and it registered itself the previous time we did that, we're going to assume it worked this time too :) */ +#endif AST_LIST_LAST(&module_list)->lib = lib; resource_being_loaded = NULL; |