]> granicus.if.org Git - libevent/commitdiff
test: allow to run init_ssl() multiple times
authorAzat Khuzhin <azat@libevent.org>
Sat, 13 Aug 2022 17:51:02 +0000 (19:51 +0200)
committerAzat Khuzhin <azat@libevent.org>
Sat, 13 Aug 2022 18:12:18 +0000 (20:12 +0200)
test/regress_openssl.c

index 3ea767c6c940a50b9e9a72b7076c99f9a35e8972..89cc01407fe9412205782af853107515ffb035c0 100644 (file)
@@ -150,6 +150,11 @@ get_ssl_ctx(void)
 void
 init_ssl(void)
 {
+       static int initialized;
+       if (initialized)
+               return;
+       initialized = 1;
+
 #if (OPENSSL_VERSION_NUMBER < 0x10100000L) || \
        (defined(LIBRESSL_VERSION_NUMBER) &&      \
                LIBRESSL_VERSION_NUMBER < 0x20700000L)