Log loadmodule dlopen() errors.

This commit is contained in:
Yossi Gottlieb 2016-03-31 21:18:45 +03:00 committed by antirez
parent 85919f80ed
commit e443ad9c29

View File

@ -1273,7 +1273,10 @@ int moduleLoad(const char *path) {
RedisModuleCtx ctx = REDISMODULE_CTX_INIT; RedisModuleCtx ctx = REDISMODULE_CTX_INIT;
handle = dlopen(path,RTLD_NOW|RTLD_LOCAL); handle = dlopen(path,RTLD_NOW|RTLD_LOCAL);
if (handle == NULL) return C_ERR; if (handle == NULL) {
serverLog(LL_WARNING, "Module %s failed to load: %s", path, dlerror());
return C_ERR;
}
onload = (int (*)(void *))(unsigned long) dlsym(handle,"RedisModule_OnLoad"); onload = (int (*)(void *))(unsigned long) dlsym(handle,"RedisModule_OnLoad");
if (onload == NULL) { if (onload == NULL) {
serverLog(LL_WARNING, serverLog(LL_WARNING,