mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
Change snd_dlopen() function to return the error string
The dlopen() function might fail also for another reason than a missing file, thus return the error string from dlerror(). Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
38a39091e3
commit
c051036e17
13 changed files with 90 additions and 51 deletions
|
|
@ -41,7 +41,7 @@ int mixer_simple_basic_dlopen(snd_mixer_class_t *class,
|
|||
struct bclass_private *priv = snd_mixer_sbasic_get_private(class);
|
||||
const char *lib = "smixer-sbase.so";
|
||||
void (*initpriv)(snd_mixer_class_t *class, struct bclass_private *priv);
|
||||
char *xlib, *path;
|
||||
char *xlib, *path, errbuf[256];
|
||||
void *h;
|
||||
int initflag = 0;
|
||||
|
||||
|
|
@ -63,9 +63,9 @@ int mixer_simple_basic_dlopen(snd_mixer_class_t *class,
|
|||
strcpy(xlib, path);
|
||||
strcat(xlib, "/");
|
||||
strcat(xlib, lib);
|
||||
h = snd_dlopen(xlib, RTLD_NOW);
|
||||
h = snd_dlopen(xlib, RTLD_NOW, errbuf, sizeof(errbuf));
|
||||
if (h == NULL) {
|
||||
SNDERR("Unable to open library '%s'", xlib);
|
||||
SNDERR("Unable to open library '%s': %s", xlib, errbuf);
|
||||
goto __error;
|
||||
}
|
||||
initpriv = dlsym(h, "alsa_mixer_sbasic_initpriv");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue