From 4dbdc06809e8bc4a6dc30fa5ec7b9772be5ae2de Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 17 Sep 2002 15:28:41 +0000 Subject: [PATCH] Added a lookup for exact ALSA library binary to allow RTLD_LOCAL usage --- src/dlmisc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/dlmisc.c b/src/dlmisc.c index ed749d3f..a5d174d7 100644 --- a/src/dlmisc.c +++ b/src/dlmisc.c @@ -27,6 +27,7 @@ * */ +#define _GNU_SOURCE #include #include "local.h" @@ -50,6 +51,12 @@ void *snd_dlopen(const char *name, int mode) #ifndef PIC if (name == NULL) return &snd_dlsym_start; +#else + if (name == NULL) { + Dl_info dlinfo; + if (dladdr(snd_dlopen, &dlinfo) > 0) + name = dlinfo.dli_fname; + } #endif return dlopen(name, mode); } -- 2.47.1