From a55adb81d0f6fcd7fe98cc444806b3b0d25efc9c Mon Sep 17 00:00:00 2001 From: Ivy Foster Date: Wed, 12 Oct 2016 15:13:31 -0500 Subject: Add ALPM_ERR_OK to _alpm_errno_t This allows functions which return an _alpm_errno_t to always return a genuine _alpm_errno_t for consistency, even in cases where there are no errors. Since ALPM_ERR_OK = 0, their callers can still simply check 'err = some_fn(); if (!err) { ... }'. Signed-off-by: Ivy Foster Signed-off-by: Allan McRae --- lib/libalpm/signing.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/libalpm/signing.c') diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c index 6557c200..527e763f 100644 --- a/lib/libalpm/signing.c +++ b/lib/libalpm/signing.c @@ -771,7 +771,7 @@ int _alpm_check_pgp_helper(alpm_handle_t *handle, const char *path, if(ret && handle->pm_errno == ALPM_ERR_SIG_MISSING) { if(optional) { _alpm_log(handle, ALPM_LOG_DEBUG, "missing optional signature\n"); - handle->pm_errno = 0; + handle->pm_errno = ALPM_ERR_OK; ret = 0; } else { _alpm_log(handle, ALPM_LOG_DEBUG, "missing required signature\n"); @@ -931,7 +931,7 @@ int SYMEXPORT alpm_pkg_check_pgp_signature(alpm_pkg_t *pkg, { ASSERT(pkg != NULL, return -1); ASSERT(siglist != NULL, RET_ERR(pkg->handle, ALPM_ERR_WRONG_ARGS, -1)); - pkg->handle->pm_errno = 0; + pkg->handle->pm_errno = ALPM_ERR_OK; return _alpm_gpgme_checksig(pkg->handle, pkg->filename, pkg->base64_sig, siglist); @@ -948,7 +948,7 @@ int SYMEXPORT alpm_db_check_pgp_signature(alpm_db_t *db, { ASSERT(db != NULL, return -1); ASSERT(siglist != NULL, RET_ERR(db->handle, ALPM_ERR_WRONG_ARGS, -1)); - db->handle->pm_errno = 0; + db->handle->pm_errno = ALPM_ERR_OK; return _alpm_gpgme_checksig(db->handle, _alpm_db_path(db), NULL, siglist); } -- cgit v1.2.3-54-g00ecf