summaryrefslogtreecommitdiff
path: root/lib/global.c
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2021-05-03 17:27:56 +0200
committerDaiki Ueno <ueno@gnu.org>2021-05-03 17:28:20 +0200
commitbf1b86d2378d00d0058bb3d1bffcff68fa867317 (patch)
treea05523d679ace2aedb9b0cc7b9f88da97be205a6 /lib/global.c
parentcca0ac94759aeeee08b80a6746ce59ad1b5a89b1 (diff)
downloadgnutls-bf1b86d2378d00d0058bb3d1bffcff68fa867317.tar.gz
global: rename GNUTLS_NO_EXPLICIT_INIT to GNUTLS_NO_IMPLICIT_INIT
The old envvar still has effect but has been marked as deprecated. Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'lib/global.c')
-rw-r--r--lib/global.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/lib/global.c b/lib/global.c
index d1bd668269..a11523150f 100644
--- a/lib/global.c
+++ b/lib/global.c
@@ -199,7 +199,7 @@ static int _gnutls_init_ret = 0;
*
* Since GnuTLS 3.3.0 this function is no longer necessary to be explicitly
* called. To disable the implicit call (in a library constructor) of this
- * function set the environment variable %GNUTLS_NO_EXPLICIT_INIT to 1.
+ * function set the environment variable %GNUTLS_NO_IMPLICIT_INIT to 1.
*
* This function performs any required precalculations, detects
* the supported CPU capabilities and initializes the underlying
@@ -487,14 +487,22 @@ const char *gnutls_check_version(const char *req_version)
static void _CONSTRUCTOR lib_init(void)
{
-int ret;
-const char *e;
+ int ret;
+ const char *e;
if (_gnutls_global_init_skip() != 0)
return;
+ e = secure_getenv("GNUTLS_NO_IMPLICIT_INIT");
+ if (e != NULL) {
+ ret = atoi(e);
+ if (ret == 1)
+ return;
+ }
+
e = secure_getenv("GNUTLS_NO_EXPLICIT_INIT");
if (e != NULL) {
+ _gnutls_debug_log("GNUTLS_NO_EXPLICIT_INIT is deprecated; use GNUTLS_NO_IMPLICIT_INIT\n");
ret = atoi(e);
if (ret == 1)
return;
@@ -509,14 +517,23 @@ const char *e;
static void _DESTRUCTOR lib_deinit(void)
{
+ int ret;
const char *e;
if (_gnutls_global_init_skip() != 0)
return;
+ e = secure_getenv("GNUTLS_NO_IMPLICIT_INIT");
+ if (e != NULL) {
+ ret = atoi(e);
+ if (ret == 1)
+ return;
+ }
+
e = secure_getenv("GNUTLS_NO_EXPLICIT_INIT");
if (e != NULL) {
- int ret = atoi(e);
+ _gnutls_debug_log("GNUTLS_NO_EXPLICIT_INIT is deprecated; use GNUTLS_NO_IMPLICIT_INIT\n");
+ ret = atoi(e);
if (ret == 1)
return;
}