From 36ae77dd4982fd29d73b695913f88665ab1d546a Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Jun 2011 20:44:49 -0500 Subject: 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 --- lib/libalpm/log.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') 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); } -- cgit v1.2.3-70-g09d2