Fix name of "locked" variable

It's called with 0 when it's already locked, with 1 when it's not.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>

GH: #1500
This commit is contained in:
Kurt Roeckx 2016-09-03 21:27:30 +02:00
parent 2f545ae45d
commit 0a3dce8257
2 changed files with 3 additions and 3 deletions

View file

@ -104,7 +104,7 @@ void engine_table_doall(ENGINE_TABLE *table, engine_table_doall_cb *cb,
*/ */
int engine_unlocked_init(ENGINE *e); int engine_unlocked_init(ENGINE *e);
int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers); int engine_unlocked_finish(ENGINE *e, int unlock_for_handlers);
int engine_free_util(ENGINE *e, int locked); int engine_free_util(ENGINE *e, int not_locked);
/* /*
* This function will reset all "set"able values in an ENGINE to NULL. This * This function will reset all "set"able values in an ENGINE to NULL. This

View file

@ -67,7 +67,7 @@ void engine_set_all_null(ENGINE *e)
e->flags = 0; e->flags = 0;
} }
int engine_free_util(ENGINE *e, int locked) int engine_free_util(ENGINE *e, int not_locked)
{ {
int i; int i;
@ -76,7 +76,7 @@ int engine_free_util(ENGINE *e, int locked)
#ifdef HAVE_ATOMICS #ifdef HAVE_ATOMICS
CRYPTO_DOWN_REF(&e->struct_ref, &i, global_engine_lock); CRYPTO_DOWN_REF(&e->struct_ref, &i, global_engine_lock);
#else #else
if (locked) if (not_locked)
CRYPTO_atomic_add(&e->struct_ref, -1, &i, global_engine_lock); CRYPTO_atomic_add(&e->struct_ref, -1, &i, global_engine_lock);
else else
i = --e->struct_ref; i = --e->struct_ref;