FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-03-2011, 08:28 PM
Dan McGee
 
Default 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>
---
lib/libalpm/signing.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 0dc15ad..9c5d8cb 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)
@@ -382,7 +382,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
"), gpgme_strerror(err));
RET_ERR(handle, ALPM_ERR_GPGME, -1);
}
--
1.7.6
 

Thread Tools




All times are GMT. The time now is 09:40 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org