From: Igor Fedotov Date: Wed, 14 Sep 2016 15:27:05 +0000 (+0000) Subject: common/PluginRegistry: improve error output forshared library load failure. X-Git-Tag: v11.0.1~228^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11081%2Fhead;p=ceph.git common/PluginRegistry: improve error output forshared library load failure. Signed-off-by: Igor Fedotov --- diff --git a/src/common/PluginRegistry.cc b/src/common/PluginRegistry.cc index 661df1c74e50..bbaadd810019 100644 --- a/src/common/PluginRegistry.cc +++ b/src/common/PluginRegistry.cc @@ -142,13 +142,16 @@ int PluginRegistry::load(const std::string &type, + name + PLUGIN_SUFFIX; void *library = dlopen(fname.c_str(), RTLD_NOW); if (!library) { + string err1(dlerror()); // 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; + lderr(cct) << __func__ + << " failed dlopen(): \"" << err1.c_str() + << "\" or \"" << dlerror() << "\"" + << dendl; return -EIO; } }