[svn-commits] kpfleming: trunk r41087 - /trunk/main/loader.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Aug 25 09:14:00 MST 2006


Author: kpfleming
Date: Fri Aug 25 11:14:00 2006
New Revision: 41087

URL: http://svn.digium.com/view/asterisk?rev=41087&view=rev
Log:
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

Modified:
    trunk/main/loader.c

Modified: trunk/main/loader.c
URL: http://svn.digium.com/view/asterisk/trunk/main/loader.c?rev=41087&r1=41086&r2=41087&view=diff
==============================================================================
--- trunk/main/loader.c (original)
+++ trunk/main/loader.c Fri Aug 25 11:14:00 2006
@@ -387,6 +387,14 @@
 	   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 @@
 	/* 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;



More information about the svn-commits mailing list