+2004-06-02 Ken Raeburn <raeburn@mit.edu>
+
+ * gss_libinit.c (gssint_lib_init): Initialize error tables here.
+ (gssint_initialize_library): Don't do it directly here. Make sure
+ gssint_lib_init has been called, and return the status.
+ (gssint_lib_fini): Remove error tables here.
+ (gssint_cleanup_library): Function deleted.
+ (initialized): Variable deleted.
+
2004-05-13 Ken Raeburn <raeburn@mit.edu>
* libgssapi_krb5.exports: Remove et_*, generic_*, gssint_*,
#include "gss_libinit.h"
#include "k5-platform.h"
-static int initialized = 0;
-
/*
* Initialize the GSSAPI library.
*/
int gssint_lib_init(void)
{
+#if !USE_BUNDLE_ERROR_STRINGS
+ add_error_table(&et_k5g_error_table);
+ add_error_table(&et_ggss_error_table);
+#endif
return k5_mutex_finish_init(&kg_vdb.mutex);
}
{
if (!INITIALIZER_RAN(gssint_lib_init) || PROGRAM_EXITING())
return;
- k5_mutex_destroy(&kg_vdb.mutex);
-}
-
-OM_uint32 gssint_initialize_library (void)
-{
- if (!initialized) {
#if !USE_BUNDLE_ERROR_STRINGS
- add_error_table(&et_k5g_error_table);
- add_error_table(&et_ggss_error_table);
+ remove_error_table(&et_k5g_error_table);
+ remove_error_table(&et_ggss_error_table);
#endif
-
- initialized = 1;
- }
-
- return CALL_INIT_FUNCTION(gssint_lib_init);
+ k5_mutex_destroy(&kg_vdb.mutex);
}
-/*
- * Clean up the Kerberos v5 lirbary state
- */
-
-void gssint_cleanup_library (void)
+OM_uint32 gssint_initialize_library (void)
{
- assert (initialized);
-
-#if !USE_BUNDLE_ERROR_STRINGS
- remove_error_table(&et_k5g_error_table);
- remove_error_table(&et_ggss_error_table);
-#endif
-
- initialized = 0;
+ return CALL_INIT_FUNCTION(gssint_lib_init);
}