Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm/log.c
diff options
context:
space:
mode:
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;
}
}