alsa/0048-snd_device_name_hint-do-not-change-the-global-error-.patch
Takashi Iwai cd5dd1370c Accepting request 150679 from home:tiwai:branches:multimedia:libs
- Backport a few fix patches from upstream, mostly for fixing
  crashes in multi-thread programs:
  0044-configure-do-not-detect-incorrect-cross-compiler.patch
  0045-ucm-Set-uc_mgr-ctl-to-NULL-after-closing-it.patch
  0046-snd_pcm_direct_parse_open_conf-use-thread-safe-getgr.patch
  0047-Add-snd_lib_error_set_local-to-install-a-thread-loca.patch
  0048-snd_device_name_hint-do-not-change-the-global-error-.patch
  0049-snd_device_name_hint-do-not-use-global-snd_config.patch
  0050-conf-Fix-a-memory-access-violation-resulting-from-im.patch

OBS-URL: https://build.opensuse.org/request/show/150679
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa?expand=0&rev=123
2013-02-01 10:22:50 +00:00

62 lines
2.1 KiB
Diff

From 25dbb102810b31c02358904d70d53c960fb0a10e Mon Sep 17 00:00:00 2001
From: Jerome Forissier <jerome@taodyne.com>
Date: Thu, 31 Jan 2013 15:47:24 +0100
Subject: [PATCH 48/50] snd_device_name_hint(): do not change the global error
handler.
This is the first step towards making this function reentrant.
Signed-off-by: Jerome Forissier <jerome@taodyne.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
src/control/namehint.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
--- a/src/control/namehint.c
+++ b/src/control/namehint.c
@@ -80,7 +80,8 @@ static void zero_handler(const char *fil
int line ATTRIBUTE_UNUSED,
const char *function ATTRIBUTE_UNUSED,
int err ATTRIBUTE_UNUSED,
- const char *fmt ATTRIBUTE_UNUSED, ...)
+ const char *fmt ATTRIBUTE_UNUSED,
+ va_list arg ATTRIBUTE_UNUSED)
{
}
@@ -212,7 +213,7 @@ static int try_config(struct hint_list *
const char *base,
const char *name)
{
- snd_lib_error_handler_t eh;
+ snd_local_error_handler_t eh;
snd_config_t *res = NULL, *cfg, *cfg1, *n;
snd_config_iterator_t i, next;
char *buf, *buf1 = NULL, *buf2;
@@ -239,10 +240,9 @@ static int try_config(struct hint_list *
sprintf(buf, "%s:CARD=%s", name, snd_ctl_card_info_get_id(list->info));
else
strcpy(buf, name);
- eh = snd_lib_error;
- snd_lib_error_set_handler(&zero_handler);
+ eh = snd_lib_error_set_local(&zero_handler);
err = snd_config_search_definition(snd_config, base, buf, &res);
- snd_lib_error_set_handler(eh);
+ snd_lib_error_set_local(eh);
if (err < 0)
goto __skip_add;
cleanup_res = 1;
@@ -337,10 +337,9 @@ static int try_config(struct hint_list *
goto __ok;
/* find, if all parameters have a default, */
/* otherwise filter this definition */
- eh = snd_lib_error;
- snd_lib_error_set_handler(&zero_handler);
+ eh = snd_lib_error_set_local(&zero_handler);
err = snd_config_search_alias_hooks(snd_config, base, buf, &res);
- snd_lib_error_set_handler(eh);
+ snd_lib_error_set_local(eh);
if (err < 0)
goto __cleanup;
if (snd_config_search(res, "@args", &cfg) >= 0) {