aboutsummaryrefslogtreecommitdiffstats
path: root/sm/keydb.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2019-05-14 11:36:08 +0000
committerWerner Koch <[email protected]>2019-05-14 11:36:08 +0000
commit22e274f839f9a6c9a511648f29cae497f6492c97 (patch)
treec1919fa1f95a1a95f23079271ffc2480c115a546 /sm/keydb.h
parentagent: Replace most assert by log_assert. (diff)
downloadgnupg-22e274f839f9a6c9a511648f29cae497f6492c97.tar.gz
gnupg-22e274f839f9a6c9a511648f29cae497f6492c97.zip
sm: Change keydb code to use the keybox locking.
* kbx/keybox-init.c (keybox_lock): New arg TIMEOUT. Change all callers to pass -1 when locking. * sm/keydb.c (struct resource_item): Remove LOCKANDLE. (struct keydb_handle): Add KEEP_LOCK. (keydb_add_resource): Use keybox locking instead of a separate dotlock for testing whether we can run a compress. (keydb_release): Reset KEEP_LOCK. (keydb_lock): Set KEEP_LOCK. (unlock_all): Take care of KEEP_LOCK. (lock_all): Use keybox_lock instead of dotlock fucntions. (keydb_delete): Remove arg UNLOCK. * sm/delete.c (delete_one): Adjust keydb_delete. Due to the KEEP_LOCK the keydb_release takes care of unlocking. -- This aligns the code more with g10/keydb.c and avoids the separate calls to dotlock_take. GnuPG-bug-id: 4505 Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'sm/keydb.h')
-rw-r--r--sm/keydb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sm/keydb.h b/sm/keydb.h
index 623462553..20dcdbe4d 100644
--- a/sm/keydb.h
+++ b/sm/keydb.h
@@ -49,7 +49,7 @@ int keydb_get_cert (KEYDB_HANDLE hd, ksba_cert_t *r_cert);
int keydb_insert_cert (KEYDB_HANDLE hd, ksba_cert_t cert);
int keydb_update_cert (KEYDB_HANDLE hd, ksba_cert_t cert);
-int keydb_delete (KEYDB_HANDLE hd, int unlock);
+int keydb_delete (KEYDB_HANDLE hd);
int keydb_locate_writable (KEYDB_HANDLE hd, const char *reserved);
void keydb_rebuild_caches (void);