X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Ferr%2Ferr.c;h=dc721c2e08530e2733efe92de37292bf16ad2f7e;hp=ad1ccd10d076bb8d7f6a90645633d74ce30fcb53;hb=69588edbaa424beb71c6a9b1be416588232cb78c;hpb=8cc44d970ced1004db0727d7a7b3e2709c442e55 diff --git a/crypto/err/err.c b/crypto/err/err.c index ad1ccd10d0..dc721c2e08 100644 --- a/crypto/err/err.c +++ b/crypto/err/err.c @@ -283,10 +283,11 @@ void err_cleanup(void) err_string_lock = NULL; } -void ERR_load_ERR_strings(void) +int ERR_load_ERR_strings(void) { #ifndef OPENSSL_NO_ERR - RUN_ONCE(&err_string_init, do_err_strings_init); + if (!RUN_ONCE(&err_string_init, do_err_strings_init)) + return 0; err_load_strings(0, ERR_str_libraries); err_load_strings(0, ERR_str_reasons); @@ -294,6 +295,7 @@ void ERR_load_ERR_strings(void) build_SYS_str_reasons(); err_load_strings(ERR_LIB_SYS, SYS_str_reasons); #endif + return 1; } static void err_load_strings(int lib, ERR_STRING_DATA *str) @@ -312,10 +314,12 @@ static void err_load_strings(int lib, ERR_STRING_DATA *str) CRYPTO_THREAD_unlock(err_string_lock); } -void ERR_load_strings(int lib, ERR_STRING_DATA *str) +int ERR_load_strings(int lib, ERR_STRING_DATA *str) { - ERR_load_ERR_strings(); + if (ERR_load_ERR_strings() == 0) + return 0; err_load_strings(lib, str); + return 1; } int ERR_unload_strings(int lib, ERR_STRING_DATA *str)