]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librados: make getxattrs ENOMEM return negative
authorJosh Durgin <josh.durgin@dreamhost.com>
Tue, 20 Dec 2011 02:00:16 +0000 (18:00 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 20 Dec 2011 02:00:16 +0000 (18:00 -0800)
This is more consistent with the rest of librados.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/librados.cc

index bd118d8d70b9cef3826cf8bd8c25f6079b1a7e44..7eaae96634ecc90a409a5a4996097c3f255bf566 100644 (file)
@@ -3857,7 +3857,7 @@ extern "C" int rados_getxattrs(rados_ioctx_t io, const char *oid,
 {
   RadosXattrsIter *it = new RadosXattrsIter();
   if (!it)
-    return ENOMEM;
+    return -ENOMEM;
   librados::IoCtxImpl *ctx = (librados::IoCtxImpl *)io;
   object_t obj(oid);
   int ret = ctx->client->getxattrs(*ctx, obj, it->attrset);
@@ -3890,7 +3890,7 @@ extern "C" int rados_getxattrs_next(rados_xattrs_iter_t iter,
   size_t bl_len = bl.length();
   it->val = (char*)malloc(bl_len);
   if (!it->val)
-    return ENOMEM;
+    return -ENOMEM;
   memcpy(it->val, bl.c_str(), bl_len);
   *val = it->val;
   *len = bl_len;