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>
This commit is contained in:
Dan McGee 2011-06-18 20:44:49 -05:00
parent 1cd6515af0
commit 36ae77dd49
1 changed files with 2 additions and 3 deletions

View File

@ -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);
}