From dd7144d9b81e4d15f6752ff79bd94ff90d2bc9c7 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Thu, 4 Apr 2019 15:09:09 +0000 Subject: Switch to pthread_mutex_init(). While PTHREAD_MUTEX_INITIALIZER can be used on OpenBSD, some other platforms do not like it. Noted by bcook@ --- src/lib/libtls/tls_config.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/libtls/tls_config.c b/src/lib/libtls/tls_config.c index 62361e6122..6a717abd48 100644 --- a/src/lib/libtls/tls_config.c +++ b/src/lib/libtls/tls_config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls_config.c,v 1.55 2019/04/01 15:58:02 jsing Exp $ */ +/* $OpenBSD: tls_config.c,v 1.56 2019/04/04 15:09:09 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -94,13 +94,15 @@ tls_config_new_internal(void) if ((config = calloc(1, sizeof(*config))) == NULL) return (NULL); - if ((config->keypair = tls_keypair_new()) == NULL) + if (pthread_mutex_init(&config->mutex, NULL) != 0) goto err; - config->mutex = PTHREAD_MUTEX_INITIALIZER; config->refcount = 1; config->session_fd = -1; + if ((config->keypair = tls_keypair_new()) == NULL) + goto err; + /* * Default configuration. */ -- cgit v1.2.3-55-g6feb