diff options
author | jsing <> | 2018-03-19 16:34:47 +0000 |
---|---|---|
committer | jsing <> | 2018-03-19 16:34:47 +0000 |
commit | c7be23675a7e4a025b9e5a5375aaed6139e653db (patch) | |
tree | a3c296b727ec4d2bb5671d0189458d547b6c3865 /src/lib/libtls/tls_client.c | |
parent | d3d84b6f3e79d4f8b89ef8f2e9d67ecaf8294433 (diff) | |
download | openbsd-c7be23675a7e4a025b9e5a5375aaed6139e653db.tar.gz openbsd-c7be23675a7e4a025b9e5a5375aaed6139e653db.tar.bz2 openbsd-c7be23675a7e4a025b9e5a5375aaed6139e653db.zip |
Automatically handle library initialisation for libtls.
Now that we have tls_init() under pthread_once(), automatically initialise
libtls from the entry point functions (tls_config(), tls_client() and
tls_server()) - this makes an explicit tls_init() call no longer a
requirement.
ok bcook@ beck@ inoguchi@
Diffstat (limited to 'src/lib/libtls/tls_client.c')
-rw-r--r-- | src/lib/libtls/tls_client.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_client.c b/src/lib/libtls/tls_client.c index 14c716fa17..04e44020ef 100644 --- a/src/lib/libtls/tls_client.c +++ b/src/lib/libtls/tls_client.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_client.c,v 1.44 2018/02/10 04:41:24 jsing Exp $ */ | 1 | /* $OpenBSD: tls_client.c,v 1.45 2018/03/19 16:34:47 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -38,6 +38,9 @@ tls_client(void) | |||
38 | { | 38 | { |
39 | struct tls *ctx; | 39 | struct tls *ctx; |
40 | 40 | ||
41 | if (tls_init() == -1) | ||
42 | return (NULL); | ||
43 | |||
41 | if ((ctx = tls_new()) == NULL) | 44 | if ((ctx = tls_new()) == NULL) |
42 | return (NULL); | 45 | return (NULL); |
43 | 46 | ||