summaryrefslogtreecommitdiff
path: root/src/seq
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2017-11-22 13:23:45 +0100
committerJaroslav Kysela <perex@perex.cz>2017-11-27 21:48:20 +0100
commitc051036e17bd8b80ebc2ef49ac76b93da6bb9aac (patch)
tree7aba7f104209f3416ccc200db8c0760ce05c2357 /src/seq
parent38a39091e324ae26238ce054f8bbae843e1e88eb (diff)
downloadalsa-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/seq')
-rw-r--r--src/seq/seq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/seq/seq.c b/src/seq/seq.c
index 630f52c3..983c4fab 100644
--- a/src/seq/seq.c
+++ b/src/seq/seq.c
@@ -823,7 +823,7 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
int streams, 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;
@@ -899,12 +899,12 @@ static int snd_seq_open_conf(snd_seq_t **seqp, const char *name,
#ifndef PIC
snd_seq_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_SEQ_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);