diff options
| author | jsing <> | 2018-03-19 16:34:47 +0000 |
|---|---|---|
| committer | jsing <> | 2018-03-19 16:34:47 +0000 |
| commit | 5fd38b4657cfd0f2e0b0b92fd650c6710e8fbc8b (patch) | |
| tree | a3c296b727ec4d2bb5671d0189458d547b6c3865 /src/lib/libtls/tls_server.c | |
| parent | 7dfb474cf3fbbf623463a9b51f61e868a92beb97 (diff) | |
| download | openbsd-5fd38b4657cfd0f2e0b0b92fd650c6710e8fbc8b.tar.gz openbsd-5fd38b4657cfd0f2e0b0b92fd650c6710e8fbc8b.tar.bz2 openbsd-5fd38b4657cfd0f2e0b0b92fd650c6710e8fbc8b.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 | ||
