summaryrefslogtreecommitdiff
path: root/lib/libalpm/log.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-07 16:06:16 -0500
committerDan McGee <dan@archlinux.org>2011-06-13 19:38:38 -0500
commite2aa952689da8763d534d1c19310eb97009f4f76 (patch)
tree7d022d67801bc01c24fef985feb9a617c48d316a /lib/libalpm/log.c
parent8b62d9bc0ade64897990b8fc6a1b6a54b629cb5b (diff)
downloadpacman-e2aa952689da8763d534d1c19310eb97009f4f76.tar.xz
Move pm_errno onto the handle
This involves some serious changes and a very messy diff, unfortunately. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/log.c')
-rw-r--r--lib/libalpm/log.c12
1 files changed, 6 insertions, 6 deletions
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;
}
}