summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/PluginRegistry.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/common/PluginRegistry.cc b/src/common/PluginRegistry.cc
index fb02d4a45a5..661df1c74e5 100644
--- a/src/common/PluginRegistry.cc
+++ b/src/common/PluginRegistry.cc
@@ -142,9 +142,15 @@ int PluginRegistry::load(const std::string &type,
+ name + PLUGIN_SUFFIX;
void *library = dlopen(fname.c_str(), RTLD_NOW);
if (!library) {
- lderr(cct) << __func__ << " failed dlopen(" << fname << "): "
- << dlerror() << dendl;
- return -EIO;
+ // fall back to plugin_dir
+ std::string fname2 = cct->_conf->plugin_dir + "/" + PLUGIN_PREFIX +
+ name + PLUGIN_SUFFIX;
+ library = dlopen(fname2.c_str(), RTLD_NOW);
+ if (!library) {
+ lderr(cct) << __func__ << " failed dlopen(" << fname << ") or dlopen("
+ << fname2 << "): " << dlerror() << dendl;
+ return -EIO;
+ }
}
const char * (*code_version)() =