X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gmodule%2Fgmodule-dl.c;h=20225df801f4d150f33fe60597e460364c3b8543;hb=2e5bd8cf47f9e1559ccc44823a2f321b8ff8c1ea;hp=28dc8a90335bbeb7e21d4c3ed2001e3994581bd8;hpb=c2d49b8f7e57e5527ec400677164ec0862005fa9;p=platform%2Fupstream%2Fglib.git
diff --git a/gmodule/gmodule-dl.c b/gmodule/gmodule-dl.c
index 28dc8a9..20225df 100644
--- a/gmodule/gmodule-dl.c
+++ b/gmodule/gmodule-dl.c
@@ -12,9 +12,7 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see .
*/
/*
@@ -27,6 +25,7 @@
/*
* MT safe
*/
+#include "config.h"
#include
@@ -90,11 +89,13 @@ fetch_dlerror (gboolean replace_null)
static gpointer
_g_module_open (const gchar *file_name,
- gboolean bind_lazy)
+ gboolean bind_lazy,
+ gboolean bind_local)
{
gpointer handle;
- handle = dlopen (file_name, RTLD_GLOBAL | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
+ handle = dlopen (file_name,
+ (bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
if (!handle)
g_module_set_error (fetch_dlerror (TRUE));
@@ -110,7 +111,11 @@ _g_module_self (void)
* are required on some systems.
*/
+#ifdef __BIONIC__
+ handle = RTLD_DEFAULT;
+#else
handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY);
+#endif
if (!handle)
g_module_set_error (fetch_dlerror (TRUE));
@@ -138,10 +143,13 @@ _g_module_symbol (gpointer handle,
const gchar *symbol_name)
{
gpointer p;
-
+ gchar *msg;
+
+ fetch_dlerror (FALSE);
p = dlsym (handle, symbol_name);
- if (!p)
- g_module_set_error (fetch_dlerror (FALSE));
+ msg = fetch_dlerror (FALSE);
+ if (msg)
+ g_module_set_error (msg);
return p;
}