]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados_create: correctly handle null id
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 16 Mar 2011 21:21:25 +0000 (14:21 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 16 Mar 2011 21:21:25 +0000 (14:21 -0700)
Passing a null id to rados_create means "use the default id."

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

index 838aa353aa8a739dc0977d7f091e53f4f387d4f5..8ee0ca0addcbbf786628a16e5766bcdb85af347a 100644 (file)
@@ -2599,7 +2599,9 @@ extern "C" int rados_create(rados_t *pcluster, const char * const id)
   if (!rados_initialized) {
     CephInitParameters iparams(CEPH_ENTITY_TYPE_CLIENT);
     iparams.conf_file = "";
-    iparams.name.set(CEPH_ENTITY_TYPE_CLIENT, id);
+    if (id) {
+      iparams.name.set(CEPH_ENTITY_TYPE_CLIENT, id);
+    }
 
     // TODO: store this conf pointer in the RadosClient and use it as our
     // configuration