diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2013-11-28 17:35:18 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2013-11-28 17:35:18 +0100 |
commit | de3500e67e61310fa13099f1f8d57cf4208f9b1a (patch) | |
tree | 12093122a0122056f2842c3242b8ffa14c15be14 /lib/fips.c | |
parent | 2977183f124aea2a3be93420528ae1b058f51648 (diff) | |
download | gnutls-de3500e67e61310fa13099f1f8d57cf4208f9b1a.tar.gz |
Added destructor and moved both *structors to fips.c
Diffstat (limited to 'lib/fips.c')
-rw-r--r-- | lib/fips.c | 15 |
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 /** |