respondd: add diagnostics about failed module load (#171)
This commit is contained in:
parent
ad8918376e
commit
706bef6245
|
@ -183,11 +183,19 @@ static const struct respondd_provider_info * get_providers(const char *filename)
|
|||
snprintf(path, sizeof(path), "./%s", filename);
|
||||
|
||||
void *handle = dlopen(path, RTLD_NOW|RTLD_LOCAL);
|
||||
if (!handle)
|
||||
if (!handle) {
|
||||
syslog(LOG_WARNING, "unable to open provider module '%s', ignoring: %s", filename, dlerror());
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// clean a potential previous error
|
||||
dlerror();
|
||||
|
||||
const struct respondd_provider_info *ret = dlsym(handle, "respondd_providers");
|
||||
if (!ret) {
|
||||
syslog(LOG_WARNING,
|
||||
"unable to load providers from '%s', ignoring: %s",
|
||||
filename, dlerror() ?: "'respondd_providers' == NULL");
|
||||
dlclose(handle);
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue