diff options
author | Jeff Garzik <jgarzik@src.gnome.org> | 1999-03-07 01:44:10 +0000 |
---|---|---|
committer | Jeff Garzik <jgarzik@src.gnome.org> | 1999-03-07 01:44:10 +0000 |
commit | a6ab9d0a6b6a2cfbf7fd2052cff6be7bc961b786 (patch) | |
tree | b467388c0d5053a9f0f1541771580339948564b4 /gmodule/gmodule.c | |
parent | 975c085b1e78d55c579342c2cf71e9aa9475e067 (diff) | |
download | glib-GLIB_1_3_HACKS.tar.gz |
merge from HEADGLIB_1_3_HACKS
Diffstat (limited to 'gmodule/gmodule.c')
-rw-r--r-- | gmodule/gmodule.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/gmodule/gmodule.c b/gmodule/gmodule.c index 99f38a6a4..e0ffc7bca 100644 --- a/gmodule/gmodule.c +++ b/gmodule/gmodule.c @@ -17,6 +17,13 @@ * Boston, MA 02111-1307, USA. */ +/* + * Modified by the GLib Team and others 1997-1999. See the AUTHORS + * file for a list of people on the GLib Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GLib at ftp://ftp.gtk.org/pub/gtk/. + */ + /* * MT safe */ @@ -64,7 +71,7 @@ static inline GModule* g_module_find_by_name (const gchar *name); /* --- variables --- */ -G_LOCK_DECLARE_STATIC (GModule); +G_LOCK_DEFINE_STATIC (GModule); const char *g_log_domain_gmodule = "GModule"; static GModule *modules = NULL; static GModule *main_module = NULL; @@ -114,15 +121,8 @@ g_module_find_by_name (const gchar *name) static inline void g_module_set_error (const gchar *error) { - gchar* module_error = g_static_private_get (&module_error_private); - if (module_error) - g_free (module_error); - if (error) - module_error = g_strdup (error); - else - module_error = NULL; + g_static_private_set (&module_error_private, g_strdup (error), g_free); errno = 0; - g_static_private_set (&module_error_private, module_error, g_free); } @@ -136,7 +136,8 @@ g_module_set_error (const gchar *error) #include "gmodule-win32.c" #else #undef CHECK_ERROR -#define CHECK_ERROR(rv) { g_module_set_error ("unsupported"); return rv; } +#define CHECK_ERROR(rv) { g_module_set_error ("dynamic modules are " \ + "not supported by this system"); return rv; } static gpointer _g_module_open (const gchar *file_name, gboolean bind_lazy) @@ -246,8 +247,7 @@ g_module_open (const gchar *file_name, return module; } - saved_error = g_module_error(); - g_static_private_set (&module_error_private, NULL, NULL); + saved_error = g_strdup (g_module_error ()); g_module_set_error (NULL); module = g_new (GModule, 1); @@ -281,6 +281,7 @@ g_module_open (const gchar *file_name, } else g_module_set_error (saved_error); + g_free (saved_error); } |