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/be_sync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/be_sync.c') diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index a8362778..856aa420 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -186,7 +186,7 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db) /* Sanity checks */ ASSERT(db != NULL, return -1); handle = db->handle; - handle->pm_errno = 0; + handle->pm_errno = ALPM_ERR_OK; ASSERT(db != handle->db_local, RET_ERR(handle, ALPM_ERR_WRONG_ARGS, -1)); ASSERT(db->servers != NULL, RET_ERR(handle, ALPM_ERR_SERVER_NONE, -1)); @@ -330,7 +330,7 @@ int SYMEXPORT alpm_db_update(int force, alpm_db_t *db) _alpm_log(handle, ALPM_LOG_DEBUG, "failed to sync db: %s\n", alpm_strerror(handle->pm_errno)); } else { - handle->pm_errno = 0; + handle->pm_errno = ALPM_ERR_OK; } _alpm_handle_unlock(handle); -- cgit v1.2.3-24-g4f1b