summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-07-01 15:51:21 -0500
committerDan McGee <dan@archlinux.org>2011-07-05 10:13:20 -0500
commite8443b1685cc99cf3a46461e7a12c9b616fac44e (patch)
tree96811e49925e3ec90c388d114f2d2a551354fc0e /lib/libalpm
parent7af0ab1cde9398c938a7a221aca5787934a16121 (diff)
downloadpacman-e8443b1685cc99cf3a46461e7a12c9b616fac44e.tar.xz
Correctly check the GPG error codes
The error code is in fact a bitmask value of an error code and an error source, so use the proper function to get only the relevant bits. For the no error case, this shouldn't ever matter, but it bit me when I was trying to compare the error code to other values and wondered why it wasn't working, so set a good example. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/signing.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 42429e2d..49d075ef 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -39,7 +39,7 @@
#if HAVE_LIBGPGME
#define CHECK_ERR(void) do { \
- if(err != GPG_ERR_NO_ERROR) { goto error; } \
+ if(gpg_err_code(err) != GPG_ERR_NO_ERROR) { goto error; } \
} while(0)
static const char *string_validity(gpgme_validity_t validity)
@@ -383,7 +383,7 @@ error:
}
FREE(sigpath);
FREE(decoded_sigdata);
- if(err != GPG_ERR_NO_ERROR) {
+ if(gpg_err_code(err) != GPG_ERR_NO_ERROR) {
_alpm_log(handle, ALPM_LOG_ERROR, _("GPGME error: %s\n"), gpgme_strerror(err));
RET_ERR(handle, ALPM_ERR_GPGME, -1);
}