diff options
author | Daiki Ueno <ueno@gnu.org> | 2021-11-16 18:00:12 +0100 |
---|---|---|
committer | Daiki Ueno <ueno@gnu.org> | 2021-11-17 07:36:49 +0100 |
commit | 84dbd61454d8dbe5b2b0f9ef2798838e95428ac1 (patch) | |
tree | 9792b6420c2f8a246a49028c95f9f816464cb572 /lib/verify-tofu.c | |
parent | 482380e9eb78ee134ca985fd7d03306b07c457ce (diff) | |
download | gnutls-84dbd61454d8dbe5b2b0f9ef2798838e95428ac1.tar.gz |
verify-tofu: switch to using static mutex for locking
Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'lib/verify-tofu.c')
-rw-r--r-- | lib/verify-tofu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/verify-tofu.c b/lib/verify-tofu.c index 4e65c739f7..40b7acdc8a 100644 --- a/lib/verify-tofu.c +++ b/lib/verify-tofu.c @@ -35,6 +35,8 @@ #include <system.h> #include <locks.h> +GNUTLS_STATIC_MUTEX(file_mutex); + struct gnutls_tdb_int { gnutls_tdb_store_func store; gnutls_tdb_store_commitment_func cstore; @@ -58,8 +60,6 @@ int store_pubkey(const char *db_name, const char *host, static int find_config_file(char *file, size_t max_size); -extern void *_gnutls_file_mutex; - struct gnutls_tdb_int default_tdb = { store_pubkey, store_commitment, @@ -404,7 +404,7 @@ int store_pubkey(const char *db_name, const char *host, gnutls_datum_t b64key = { NULL, 0 }; int ret; - ret = gnutls_mutex_lock(&_gnutls_file_mutex); + ret = gnutls_static_mutex_lock(&file_mutex); if (ret != 0) return gnutls_assert_val(GNUTLS_E_LOCKING_ERROR); @@ -434,7 +434,7 @@ int store_pubkey(const char *db_name, const char *host, if (fp != NULL) fclose(fp); - gnutls_mutex_unlock(&_gnutls_file_mutex); + gnutls_static_mutex_unlock(&file_mutex); gnutls_free(b64key.data); return ret; |