diff options
| author | Jaroslav Kysela <perex@perex.cz> | 2017-11-22 13:23:45 +0100 |
|---|---|---|
| committer | Jaroslav Kysela <perex@perex.cz> | 2017-11-27 21:48:20 +0100 |
| commit | c051036e17bd8b80ebc2ef49ac76b93da6bb9aac (patch) | |
| tree | 7aba7f104209f3416ccc200db8c0760ce05c2357 /src/timer/timer.c | |
| parent | 38a39091e324ae26238ce054f8bbae843e1e88eb (diff) | |
| download | alsa-lib-c051036e17bd8b80ebc2ef49ac76b93da6bb9aac.tar.gz | |
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>
Diffstat (limited to 'src/timer/timer.c')
| -rw-r--r-- | src/timer/timer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/timer/timer.c b/src/timer/timer.c index e027c903..8c49737e 100644 --- a/src/timer/timer.c +++ b/src/timer/timer.c @@ -76,7 +76,7 @@ static int snd_timer_open_conf(snd_timer_t **timer, snd_config_t *timer_conf, int mode) { const char *str; - char buf[256]; + char buf[256], errbuf[256]; int err; snd_config_t *conf, *type_conf = NULL; snd_config_iterator_t i, next; @@ -150,12 +150,12 @@ static int snd_timer_open_conf(snd_timer_t **timer, #ifndef PIC snd_timer_open_symbols(); #endif - h = snd_dlopen(lib, RTLD_NOW); + h = snd_dlopen(lib, RTLD_NOW, errbuf, sizeof(errbuf)); if (h) open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_TIMER_DLSYM_VERSION)); err = 0; if (!h) { - SNDERR("Cannot open shared library %s", lib); + SNDERR("Cannot open shared library %s (%s)", lib, errbuf); err = -ENOENT; } else if (!open_func) { SNDERR("symbol %s is not defined inside %s", open_name, lib); |
