1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

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.
This commit is contained in:
Werner Koch 2011-04-29 15:07:11 +02:00
parent 740629de00
commit afe5c1a370
8 changed files with 383 additions and 328 deletions

View file

@ -434,12 +434,12 @@ list_all (int secret)
hd = keydb_new ();
if (!hd)
rc = G10ERR_GENERAL;
rc = gpg_error (GPG_ERR_GENERAL);
else
rc = keydb_search_first (hd);
if (rc)
{
if (rc != -1)
if (gpg_err_code (rc) != GPG_ERR_NOT_FOUND)
log_error ("keydb_search_first failed: %s\n", g10_errstr (rc));
goto leave;
}
@ -479,7 +479,7 @@ list_all (int secret)
keyblock = NULL;
}
while (!(rc = keydb_search_next (hd)));
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));
if (opt.check_sigs && !opt.with_colons)