]> git.alsa-project.org Git - alsa-lib.git/commitdiff
dlmisc: fix snd_plugin_dir locking for not DL_ORIGIN_AVAILABLE
authorJaroslav Kysela <perex@perex.cz>
Thu, 29 Oct 2020 19:31:19 +0000 (20:31 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 29 Oct 2020 19:32:10 +0000 (20:32 +0100)
Fixes: 8580c081c2 ("dlsym: add support for ALSA_PLUGIN_DIR environment variable")
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/dlmisc.c

index f20eb59373cfe96a9c738e8b88b05de7851bf269..1dd9135641c1013adae5255dd21dcb50e0cf8412 100644 (file)
@@ -46,7 +46,7 @@ static int snd_plugin_dir_set = 0;
 static char *snd_plugin_dir = NULL;
 #endif
 
-#if defined(DL_ORIGIN_AVAILABLE) && defined(HAVE_LIBPTHREAD)
+#ifdef HAVE_LIBPTHREAD
 static pthread_mutex_t snd_dlpath_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 static inline void snd_dlpath_lock(void)
@@ -440,12 +440,10 @@ void snd_dlobj_cache_cleanup(void)
                free(c);
        }
        snd_dlobj_unlock();
-#ifdef DL_ORIGIN_AVAILABLE
        snd_dlpath_lock();
        snd_plugin_dir_set = 0;
        free(snd_plugin_dir);
        snd_plugin_dir = NULL;
        snd_dlpath_unlock();
-#endif
 }
 #endif