mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-29 20:34:11 +02:00
Handle valid symbols that are NULL correctly. (#385388, Felix Kater)
2006-12-13 Matthias Clasen <mclasen@redhat.com> * gmodule.c (g_module_open): * gmodule-dl.c (_g_module_symbol): Handle valid symbols that are NULL correctly. (#385388, Felix Kater)
This commit is contained in:
committed by
Matthias Clasen
parent
caecf2dda0
commit
ea1512221b
@@ -96,7 +96,7 @@ _g_module_open (const gchar *file_name,
|
||||
gpointer handle;
|
||||
|
||||
handle = dlopen (file_name,
|
||||
(bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
|
||||
(bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
|
||||
if (!handle)
|
||||
g_module_set_error (fetch_dlerror (TRUE));
|
||||
|
||||
@@ -140,10 +140,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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user