static CRYPTO_RWLOCK *err_string_lock;
/* Predeclarations of the "err_defaults" functions */
-static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit);
+static LHASH_OF(ERR_STRING_DATA) *get_hash(int create);
static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *);
/*
return (int)(a->error - b->error);
}
-static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit)
+static LHASH_OF(ERR_STRING_DATA) *get_hash(int create)
{
- LHASH_OF(ERR_STRING_DATA) *ret = NULL;
-
- if (lockit)
- CRYPTO_THREAD_write_lock(err_string_lock);
- if (!int_error_hash && create) {
+ if (int_error_hash == NULL && create)
int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash,
err_string_data_cmp);
- }
- if (int_error_hash != NULL)
- ret = int_error_hash;
- if (lockit)
- CRYPTO_THREAD_unlock(err_string_lock);
-
- return ret;
+ return int_error_hash;
}
static ERR_STRING_DATA *int_err_get_item(const ERR_STRING_DATA *d)
LHASH_OF(ERR_STRING_DATA) *hash;
CRYPTO_THREAD_read_lock(err_string_lock);
- hash = get_hash(0, 0);
+ hash = get_hash(0);
if (hash)
p = lh_ERR_STRING_DATA_retrieve(hash, d);
CRYPTO_THREAD_unlock(err_string_lock);
LHASH_OF(ERR_STRING_DATA) *hash;
CRYPTO_THREAD_write_lock(err_string_lock);
- hash = get_hash(1, 0);
+ hash = get_hash(1);
if (hash) {
for (; str->error; str++) {
if (lib)
return 0;
CRYPTO_THREAD_write_lock(err_string_lock);
- hash = get_hash(0, 0);
+ hash = get_hash(0);
if (hash) {
for (; str->error; str++) {
if (lib)
return ret;
}
-LHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void)
-{
- return get_hash(0, 1);
-}
-
const char *ERR_lib_error_string(unsigned long e)
{
ERR_STRING_DATA d, *p;