diff options
author | Jaroslav Kysela <perex@perex.cz> | 2001-08-15 12:12:16 +0000 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2001-08-15 12:12:16 +0000 |
commit | b45c08611c0bab46c2e2d2b071bf7331c0ba0c62 (patch) | |
tree | 82417d8307c17c92119465f911bfa4f611548e7f /src/timer | |
parent | 36a28100813aa02da47fa20e038abedf8193b85f (diff) |
Added symbol versioning for dlsym-callbacks.
Removed snd_config_refer_load from confmisc.c and pcm.c.
Diffstat (limited to 'src/timer')
-rw-r--r-- | src/timer/timer.c | 10 | ||||
-rw-r--r-- | src/timer/timer_hw.c | 1 | ||||
-rw-r--r-- | src/timer/timer_query.c | 10 | ||||
-rw-r--r-- | src/timer/timer_query_hw.c | 1 |
4 files changed, 16 insertions, 6 deletions
diff --git a/src/timer/timer.c b/src/timer/timer.c index f5078436..cdf41a08 100644 --- a/src/timer/timer.c +++ b/src/timer/timer.c @@ -101,10 +101,14 @@ static int snd_timer_open_conf(snd_timer_t **timer, open_name = buf; snprintf(buf, sizeof(buf), "_snd_timer_%s_open", str); } - if (!lib) - lib = ALSA_LIB; h = dlopen(lib, RTLD_NOW); - open_func = h ? dlsym(h, open_name) : NULL; + if (h) { + if ((err = snd_dlsym_verify(h, open_name, SND_DLSYM_VERSION(SND_TIMER_DLSYM_VERSION))) < 0) { + dlclose(h); + goto _err; + } + open_func = dlsym(h, open_name); + } if (!h) { SNDERR("Cannot open shared library %s", lib); err = -ENOENT; diff --git a/src/timer/timer_hw.c b/src/timer/timer_hw.c index bea25196..dd1f20d7 100644 --- a/src/timer/timer_hw.c +++ b/src/timer/timer_hw.c @@ -200,6 +200,7 @@ int snd_timer_hw_open(snd_timer_t **handle, const char *name, int dev_class, int return 0; } +SND_DLSYM_BUILD_VERSION(_snd_timer_hw_open, SND_TIMER_DLSYM_VERSION); int _snd_timer_hw_open(snd_timer_t **timer, char *name, snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf, int mode) diff --git a/src/timer/timer_query.c b/src/timer/timer_query.c index 1492e1ed..ebdd65c3 100644 --- a/src/timer/timer_query.c +++ b/src/timer/timer_query.c @@ -100,10 +100,14 @@ static int snd_timer_query_open_conf(snd_timer_query_t **timer, open_name = buf; snprintf(buf, sizeof(buf), "_snd_timer_query_%s_open", str); } - if (!lib) - lib = ALSA_LIB; h = dlopen(lib, RTLD_NOW); - open_func = h ? dlsym(h, open_name) : NULL; + if (h) { + if ((err = snd_dlsym_verify(h, open_name, SND_DLSYM_VERSION(SND_TIMER_QUERY_DLSYM_VERSION))) < 0) { + dlclose(h); + goto _err; + } + open_func = dlsym(h, open_name); + } if (!h) { SNDERR("Cannot open shared library %s", lib); err = -ENOENT; diff --git a/src/timer/timer_query_hw.c b/src/timer/timer_query_hw.c index 6d70a317..e63a4811 100644 --- a/src/timer/timer_query_hw.c +++ b/src/timer/timer_query_hw.c @@ -88,6 +88,7 @@ int snd_timer_query_hw_open(snd_timer_query_t **handle, const char *name, int mo return 0; } +SND_DLSYM_BUILD_VERSION(_snd_timer_query_hw_open, SND_TIMER_QUERY_DLSYM_VERSION); int _snd_timer_query_hw_open(snd_timer_query_t **timer, char *name, snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf, int mode) |