]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rados: fix error printout for mapext
authorSage Weil <sage.weil@dreamhost.com>
Sat, 21 Apr 2012 20:32:46 +0000 (13:32 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Sat, 21 Apr 2012 20:32:46 +0000 (13:32 -0700)
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/rados.cc

index a33057411205fff257931f5d14323f20a109a5eb..9f6959204c9a5b00da30da423fcbb3e902a14206 100644 (file)
@@ -925,7 +925,7 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
     std::map<uint64_t,uint64_t> m;
     ret = io_ctx.mapext(oid, 0, -1, m);
     if (ret < 0) {
-      cerr << "mapext error on " << pool_name << "/" << oid << ": " << strerror_r(-ret, buf, sizeof(buf)) << std::endl;
+      cerr << "mapext error on " << pool_name << "/" << oid << ": " << cpp_strerror(ret) << std::endl;
       return 1;
     }
     std::map<uint64_t,uint64_t>::iterator iter;
@@ -1288,8 +1288,8 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts,
     usage_exit();
   }
 
-  if (ret)
-    cerr << "error " << (-ret) << ": " << strerror_r(-ret, buf, sizeof(buf)) << std::endl;
+  if (ret < 0)
+    cerr << "error " << (-ret) << ": " << cpp_strerror(ret) << std::endl;
   return (ret < 0) ? 1 : 0;
 }