summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/util.h
diff options
context:
space:
mode:
authorIvy Foster <ivy.foster@gmail.com>2016-10-12 22:13:31 +0200
committerAllan McRae <allan@archlinux.org>2016-10-22 12:50:55 +0200
commita55adb81d0f6fcd7fe98cc444806b3b0d25efc9c (patch)
tree8bf6a8b9f048a9b1073d964ffcead9015f404bd0 /lib/libalpm/util.h
parenta79be86f5751b4341f1339a32a5a8737439ac28d (diff)
downloadpacman-a55adb81d0f6fcd7fe98cc444806b3b0d25efc9c.tar.gz
pacman-a55adb81d0f6fcd7fe98cc444806b3b0d25efc9c.tar.xz
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 <ivy.foster@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib/libalpm/util.h')
-rw-r--r--lib/libalpm/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h
index 5a2c105d..b9c5c172 100644
--- a/lib/libalpm/util.h
+++ b/lib/libalpm/util.h
@@ -77,7 +77,7 @@ void _alpm_alloc_fail(size_t size);
#define DOUBLE_EQ(x, y) (fabs((x) - (y)) < DBL_EPSILON)
-#define CHECK_HANDLE(handle, action) do { if(!(handle)) { action; } (handle)->pm_errno = 0; } while(0)
+#define CHECK_HANDLE(handle, action) do { if(!(handle)) { action; } (handle)->pm_errno = ALPM_ERR_OK; } while(0)
/** Standard buffer size used throughout the library. */
#ifdef BUFSIZ