From 287e8d356e8be8ae4af00e34e25d3f6727945952 Mon Sep 17 00:00:00 2001 From: Rémy Oudompheng Date: Mon, 28 Mar 2011 21:47:08 +0200 Subject: alpm/handle.c: ensure handle is not NULL before proceeding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Many alpm_option_get/set_*() functions already check this and set pm_errno to the right value, but not all, so this improves consistency. Signed-off-by: Rémy Oudompheng Signed-off-by: Dan McGee --- lib/libalpm/util.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libalpm/util.h') diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h index 3232f004..c66e9881 100644 --- a/lib/libalpm/util.h +++ b/lib/libalpm/util.h @@ -57,6 +57,10 @@ #define ASSERT(cond, action) do { if(!(cond)) { action; } } while(0) +#define RET_ERR_VOID(err) do { pm_errno = (err); \ + _alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerrorlast()); \ + return; } while(0) + #define RET_ERR(err, ret) do { pm_errno = (err); \ _alpm_log(PM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerrorlast()); \ return(ret); } while(0) -- cgit v1.2.3-24-g4f1b