aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/call-keyboxd.c14
-rw-r--r--g10/keydb-private.h1
-rw-r--r--g10/keydb.c16
3 files changed, 15 insertions, 16 deletions
diff --git a/g10/call-keyboxd.c b/g10/call-keyboxd.c
index 1bfcae345..5cb6be512 100644
--- a/g10/call-keyboxd.c
+++ b/g10/call-keyboxd.c
@@ -326,20 +326,6 @@ keydb_release (KEYDB_HANDLE hd)
}
-/* Take a lock if we are not using the keyboxd. */
-gpg_error_t
-keydb_lock (KEYDB_HANDLE hd)
-{
- if (!hd)
- return gpg_error (GPG_ERR_INV_ARG);
-
- if (!hd->use_keyboxd)
- return internal_keydb_lock (hd);
-
- return 0;
-}
-
-
/* Return the keyblock last found by keydb_search() in *RET_KB.
*
* On success, the function returns 0 and the caller must free *RET_KB
diff --git a/g10/keydb-private.h b/g10/keydb-private.h
index dae05d658..dd404285e 100644
--- a/g10/keydb-private.h
+++ b/g10/keydb-private.h
@@ -162,7 +162,6 @@ gpg_error_t keydb_parse_keyblock (iobuf_t iobuf, int pk_no, int uid_no,
gpg_error_t internal_keydb_init (KEYDB_HANDLE hd);
void internal_keydb_deinit (KEYDB_HANDLE hd);
-gpg_error_t internal_keydb_lock (KEYDB_HANDLE hd);
gpg_error_t internal_keydb_get_keyblock (KEYDB_HANDLE hd, KBNODE *ret_kb);
gpg_error_t internal_keydb_update_keyblock (ctrl_t ctrl,
diff --git a/g10/keydb.c b/g10/keydb.c
index 590b45713..f155d8e7a 100644
--- a/g10/keydb.c
+++ b/g10/keydb.c
@@ -929,7 +929,7 @@ internal_keydb_deinit (KEYDB_HANDLE hd)
/* Take a lock on the files immediately and not only during insert or
* update. This lock is released with keydb_release. */
-gpg_error_t
+static gpg_error_t
internal_keydb_lock (KEYDB_HANDLE hd)
{
gpg_error_t err;
@@ -944,6 +944,20 @@ internal_keydb_lock (KEYDB_HANDLE hd)
}
+/* Take a lock if we are not using the keyboxd. */
+gpg_error_t
+keydb_lock (KEYDB_HANDLE hd)
+{
+ if (!hd)
+ return gpg_error (GPG_ERR_INV_ARG);
+
+ if (!hd->use_keyboxd)
+ return internal_keydb_lock (hd);
+
+ return 0;
+}
+
+
/* Set a flag on the handle to suppress use of cached results. This
* is required for updating a keyring and for key listings. Fixme:
* Using a new parameter for keydb_new might be a better solution. */