mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2026-02-05 04:06:34 -05:00
error: return old snd_lib_error_set_handler() behaviour
Unfortunately, the case when the old application sets own error callback using the old method, was not handled properly in snd_lib_vlog_default() function. Make sure that only error messages are passed to this old callback and silent other log priorities. Link: https://bugs.gentoo.org/968131 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
731d5fb9d8
commit
f55eece85c
1 changed files with 8 additions and 0 deletions
|
|
@ -34,6 +34,8 @@
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
static void snd_lib_error_default(const char *file, int line, const char *function, int errcode, const char *fmt, ...);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of error codes in US ASCII.
|
* Array of error codes in US ASCII.
|
||||||
*/
|
*/
|
||||||
|
|
@ -317,6 +319,12 @@ static void snd_lib_vlog_default(int prio, int interface, const char *file, int
|
||||||
local_error(file, line, function, errcode, fmt, arg);
|
local_error(file, line, function, errcode, fmt, arg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (snd_lib_error != snd_lib_error_default) {
|
||||||
|
if (prio == SND_LOG_ERROR)
|
||||||
|
snd_lib_error(file, line, function, errcode, fmt, arg);
|
||||||
|
/* ignore other priorities - restore old behaviour */
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!snd_lib_log_filter(prio, interface, NULL))
|
if (!snd_lib_log_filter(prio, interface, NULL))
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue