From e2aa952689da8763d534d1c19310eb97009f4f76 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 7 Jun 2011 16:06:16 -0500 Subject: Move pm_errno onto the handle This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee --- lib/libalpm/log.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/libalpm/log.c') diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c index 023bfc9e..2b6385b1 100644 --- a/lib/libalpm/log.c +++ b/lib/libalpm/log.c @@ -39,6 +39,7 @@ extern pmhandle_t *handle; */ /** A printf-like function for logging. + * @param handle the context handle * @param fmt output format * @return 0 on success, -1 on error (pm_errno is set accordingly) */ @@ -47,8 +48,7 @@ int SYMEXPORT alpm_logaction(pmhandle_t *handle, const char *fmt, ...) int ret; va_list args; - /* Sanity checks */ - ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); + ASSERT(handle != NULL, return -1); /* check if the logstream is open already, opening it if needed */ if(handle->logstream == NULL) { @@ -56,13 +56,13 @@ int SYMEXPORT alpm_logaction(pmhandle_t *handle, const char *fmt, ...) /* if we couldn't open it, we have an issue */ if(handle->logstream == NULL) { if(errno == EACCES) { - pm_errno = PM_ERR_BADPERMS; + handle->pm_errno = PM_ERR_BADPERMS; } else if(errno == ENOENT) { - pm_errno = PM_ERR_NOT_A_DIR; + handle->pm_errno = PM_ERR_NOT_A_DIR; } else { - pm_errno = PM_ERR_SYSTEM; + handle->pm_errno = PM_ERR_SYSTEM; } - return -1; + return -1; } } -- cgit v1.2.3-24-g4f1b