mirror of
https://github.com/moparisthebest/pacman
synced 2025-01-09 04:57:59 -05:00
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:
parent
1cd6515af0
commit
36ae77dd49
@ -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, ...)
|
void _alpm_log(pmhandle_t *handle, pmloglevel_t flag, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
alpm_cb_log logcb = alpm_option_get_logcb(handle);
|
|
||||||
|
|
||||||
if(logcb == NULL) {
|
if(handle == NULL || handle->logcb == NULL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
logcb(flag, fmt, args);
|
handle->logcb(flag, fmt, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user