]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
libceph: fix some bugs
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 21 Apr 2011 21:24:15 +0000 (14:24 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Mon, 25 Apr 2011 18:05:43 +0000 (11:05 -0700)
Fix some bugs in libceph and testceph.

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/client/testceph.cc
src/libceph.cc

index 93148369fec364e18f2d16c985d06ce06f83ed14..a5b1370a9e0b6b61d41d1a0e1ab188b608a71db4 100644 (file)
@@ -27,6 +27,7 @@ int main(int argc, const char **argv)
     return 1;
   }
 
+  ceph_conf_read_file(cmount, NULL);
   ceph_conf_parse_argv(cmount, argc, argv);
 
   char buf[128];
index d024c00d25fcee672046edb5af67753af10168c4..bff340b328fb29451ac68c5f575be0474f01aa28 100644 (file)
@@ -79,7 +79,9 @@ public:
 
     //network connection
     messenger = new SimpleMessenger();
-    if (messenger->register_entity(entity_name_t::CLIENT())) {
+    if (!messenger->register_entity(entity_name_t::CLIENT())) {
+      messenger->destroy();
+      messenger = NULL;
       shutdown();
       return -1001;
     }
@@ -115,6 +117,7 @@ public:
       mounted = false;
     }
     if (client) {
+      client->shutdown();
       delete client;
       client = NULL;
     }
@@ -230,6 +233,8 @@ extern "C" int ceph_create(ceph_mount_t **cmount, const char * const id)
     conf = common_preinit(iparams, CODE_ENVIRONMENT_LIBRARY, 0);
     conf->parse_env(); // environment variables override
     conf->apply_changes();
+
+    keyring_init(conf);
   }
   ret = ceph_create_with_config_impl(cmount, conf);
   libceph_init_mutex.Unlock();
@@ -276,7 +281,7 @@ extern "C" int ceph_conf_get(ceph_mount_t *cmount, const char *option,
 extern "C" int ceph_mount(ceph_mount_t *cmount, const char *root)
 {
   std::string mount_root;
-  if (!root)
+  if (root)
     mount_root = root;
   return cmount->mount(mount_root);
 }