aboutsummaryrefslogtreecommitdiffstats
path: root/g10/trustdb.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2011-04-29 13:07:11 +0000
committerWerner Koch <[email protected]>2011-04-29 13:07:11 +0000
commitafe5c1a370ef1d01fd3a4c66dfd231d4a9bfc498 (patch)
treef700ffeea1208b761afbbce24058c4260f3dfc1b /g10/trustdb.c
parentUpdate OpenPGP parser to support ECC (diff)
downloadgnupg-afe5c1a370ef1d01fd3a4c66dfd231d4a9bfc498.tar.gz
gnupg-afe5c1a370ef1d01fd3a4c66dfd231d4a9bfc498.zip
Re-indentation of keydb.c and error code changes.
Returning -1 as an error code is not very clean given that gpg error has more descriptive error codes. Thus we now return GPG_ERR_NOT_FOUND for all search operations and adjusted all callers.
Diffstat (limited to 'g10/trustdb.c')
-rw-r--r--g10/trustdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index c6ff6922d..006db04f4 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -2107,7 +2107,7 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
desc.skipfnc = search_skipfnc;
desc.skipfncvalue = full_trust;
rc = keydb_search (hd, &desc, 1);
- if (rc == -1)
+ if (gpg_err_code (rc) == GPG_ERR_NOT_FOUND)
{
keys[nkeys].keyblock = NULL;
return keys;
@@ -2181,7 +2181,7 @@ validate_key_list (KEYDB_HANDLE hd, KeyHashTable full_trust,
keyblock = NULL;
}
while ( !(rc = keydb_search (hd, &desc, 1)) );
- if (rc && rc != -1)
+ if (rc && gpg_err_code (rc) != GPG_ERR_NOT_FOUND)
{
log_error ("keydb_search_next failed: %s\n", g10_errstr(rc));
xfree (keys);