exsltRegisterAll in proper place
[yaz-moved-to-github.git] / src / init_globals.c
index 1f2905c..81cb966 100644 (file)
 #include <gcrypt.h>
 #endif
 
+#if YAZ_HAVE_EXSLT
+#include <libexslt/exslt.h>
+#endif
+
 static int yaz_init_flag = 0;
 #if YAZ_POSIX_THREADS
 static pthread_mutex_t yaz_init_mutex = PTHREAD_MUTEX_INITIALIZER;
@@ -51,7 +55,10 @@ void yaz_init_globals(void)
             gcry_control(GCRYCTL_INITIALIZATION_FINISHED, NULL, 0);
         }
 #endif
-        yaz_init_flag = 1;
+#if YAZ_HAVE_EXSLT
+        exsltRegisterAll();
+#endif
+        yaz_init_flag = 1; /* must be last, before unlocking */
     }
 #if YAZ_POSIX_THREADS
     pthread_mutex_unlock(&yaz_init_mutex);