summaryrefslogtreecommitdiff
path: root/lib/libalpm/log.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-18 20:44:49 -0500
committerDan McGee <dan@archlinux.org>2011-06-20 00:03:53 -0500
commit36ae77dd4982fd29d73b695913f88665ab1d546a (patch)
tree763b090c9c83939eebb89cbe8690ce0fb4f98962 /lib/libalpm/log.c
parent1cd6515af0ae5d1c3dabd30749a37cfefa7dc4f5 (diff)
downloadpacman-36ae77dd4982fd29d73b695913f88665ab1d546a.tar.xz
Don't call public API in _alpm_log()
Calling get_logcb() here would reset any previous setting of handle->pm_errno due to the CHECK_HANDLE() macro contained within. This would make error setting a bit funny if one set pm_errno before calling _alpm_log(), such as in the RET_ERR() macro. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/log.c')
-rw-r--r--lib/libalpm/log.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libalpm/log.c b/lib/libalpm/log.c
index 91bcb823..8bb88117 100644
--- a/lib/libalpm/log.c
+++ b/lib/libalpm/log.c
@@ -86,14 +86,13 @@ int SYMEXPORT alpm_logaction(pmhandle_t *handle, const char *fmt, ...)
void _alpm_log(pmhandle_t *handle, pmloglevel_t flag, const char *fmt, ...)
{
va_list args;
- alpm_cb_log logcb = alpm_option_get_logcb(handle);
- if(logcb == NULL) {
+ if(handle == NULL || handle->logcb == NULL) {
return;
}
va_start(args, fmt);
- logcb(flag, fmt, args);
+ handle->logcb(flag, fmt, args);
va_end(args);
}