From afe5c1a370ef1d01fd3a4c66dfd231d4a9bfc498 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 29 Apr 2011 15:07:11 +0200 Subject: 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. --- g10/keylist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'g10/keylist.c') diff --git a/g10/keylist.c b/g10/keylist.c index db7467d3d..f6b8cffb2 100644 --- a/g10/keylist.c +++ b/g10/keylist.c @@ -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) -- cgit