]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/PluginRegistry: improve error output forshared library load failure. 11081/head
authorIgor Fedotov <ifedotov@mirantis.com>
Wed, 14 Sep 2016 15:27:05 +0000 (15:27 +0000)
committerIgor Fedotov <ifedotov@mirantis.com>
Wed, 14 Sep 2016 15:28:44 +0000 (15:28 +0000)
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
src/common/PluginRegistry.cc

index 661df1c74e50f90ca0402e1313e2a2facf79dbe8..bbaadd810019fd798167700fc150a5372f5e9d2e 100644 (file)
@@ -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;
     }
   }