summaryrefslogtreecommitdiff
path: root/lib/fips.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2013-11-28 17:35:18 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2013-11-28 17:35:18 +0100
commitde3500e67e61310fa13099f1f8d57cf4208f9b1a (patch)
tree12093122a0122056f2842c3242b8ffa14c15be14 /lib/fips.c
parent2977183f124aea2a3be93420528ae1b058f51648 (diff)
downloadgnutls-de3500e67e61310fa13099f1f8d57cf4208f9b1a.tar.gz
Added destructor and moved both *structors to fips.c
Diffstat (limited to 'lib/fips.c')
-rw-r--r--lib/fips.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/fips.c b/lib/fips.c
index 690c4cddd8..a8beda02d4 100644
--- a/lib/fips.c
+++ b/lib/fips.c
@@ -326,6 +326,21 @@ error:
return GNUTLS_E_SELF_TEST_ERROR;
}
+
+__attribute__((constructor))
+static void lib_init(void)
+{
+ if (gnutls_global_init2(GNUTLS_GLOBAL_INIT_MINIMAL|GNUTLS_GLOBAL_INIT_CRYPTO) < 0) {
+ fprintf(stderr, "Error in GnuTLS initialization");
+ abort();
+ }
+}
+
+__attribute__((destructor))
+static void lib_deinit(void)
+{
+ gnutls_global_deinit();
+}
#endif
/**