mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
dlsym: use the only alsa plugins directory for the internal modules
The commitb2a4272ecbintroduced a slightly different behaviour for ALSA_PLUGIN_DIR. The fallback causes that the alsa libraries are searched in all library directories. It was never intended to do the system wide library lookups for internal modules. Fixes:b2a4272ecb("snd_dlopen: do not use absolute plugin path for snd_dlopen() calls") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
2a204a5412
commit
aa89ad9362
1 changed files with 6 additions and 17 deletions
19
src/dlmisc.c
19
src/dlmisc.c
|
|
@ -147,31 +147,20 @@ void *snd_dlopen(const char *name, int mode, char *errbuf, size_t errbuflen)
|
||||||
* via ld.so.conf.
|
* via ld.so.conf.
|
||||||
*/
|
*/
|
||||||
void *handle = NULL;
|
void *handle = NULL;
|
||||||
const char *filename = NULL;
|
const char *filename = name;
|
||||||
char path[PATH_MAX];
|
char path[PATH_MAX];
|
||||||
|
|
||||||
if (name && name[0] != '/') {
|
if (name && name[0] != '/') {
|
||||||
if (snd_dlpath(path, sizeof(path), name) == 0) {
|
if (snd_dlpath(path, sizeof(path), name) == 0)
|
||||||
filename = path;
|
filename = path;
|
||||||
|
}
|
||||||
handle = dlopen(filename, mode);
|
handle = dlopen(filename, mode);
|
||||||
if (!handle) {
|
|
||||||
/* if the filename exists and cannot be opened */
|
|
||||||
/* return immediately */
|
|
||||||
if (access(filename, X_OK) == 0)
|
|
||||||
goto errpath;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!handle) {
|
|
||||||
filename = name;
|
|
||||||
handle = dlopen(name, mode);
|
|
||||||
if (!handle)
|
if (!handle)
|
||||||
goto errpath;
|
goto errpath;
|
||||||
}
|
|
||||||
return handle;
|
return handle;
|
||||||
errpath:
|
errpath:
|
||||||
if (errbuf)
|
if (errbuf)
|
||||||
snprintf(errbuf, errbuflen, "%s: %s", filename, dlerror());
|
snprintf(errbuf, errbuflen, "%s", dlerror());
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue