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_server.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_server.c')
-rw-r--r-- | src/lib/libtls/tls_server.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/libtls/tls_server.c b/src/lib/libtls/tls_server.c index 98b0957437..44bef6bb11 100644 --- a/src/lib/libtls/tls_server.c +++ b/src/lib/libtls/tls_server.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: tls_server.c,v 1.43 2018/02/08 05:56:49 jsing Exp $ */ | 1 | /* $OpenBSD: tls_server.c,v 1.44 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 | * |
@@ -31,6 +31,9 @@ tls_server(void) | |||
31 | { | 31 | { |
32 | struct tls *ctx; | 32 | struct tls *ctx; |
33 | 33 | ||
34 | if (tls_init() == -1) | ||
35 | return (NULL); | ||
36 | |||
34 | if ((ctx = tls_new()) == NULL) | 37 | if ((ctx = tls_new()) == NULL) |
35 | return (NULL); | 38 | return (NULL); |
36 | 39 | ||