]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools: clean up errors in ceph-objectstore-tool
authorJohn Spray <john.spray@redhat.com>
Mon, 20 Apr 2015 16:28:15 +0000 (17:28 +0100)
committerDavid Zafman <dzafman@redhat.com>
Thu, 25 Feb 2016 20:50:23 +0000 (12:50 -0800)
We use negative error codes everywhere else, should
use them here too.  Also add a couple of strategically
placed prints.

Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit 8e5594da29e782b6efd046ed03f313599dafa1c5)

Conflicts:
src/tools/RadosDump.cc (Excluded, not in Hammer)

src/tools/ceph_objectstore_tool.cc

index 6391961966354248c3ec1342eb806a94f66fd6fd..396964f295e42413bc16993de6d1f88e8d2fae7c 100644 (file)
@@ -1924,6 +1924,7 @@ int do_import(ObjectStore *store, OSDSuperblock& sb, bool force, string pgidstr)
   if (ret)
     return ret;
   if (type != TYPE_PG_BEGIN) {
+    cerr << "Invalid first section type " << type << std::endl;
     return -EFAULT;
   }
 
@@ -3100,7 +3101,7 @@ int main(int argc, char **argv)
       cerr << "do_import threw exception error " << e.what() << std::endl;
       ret = -EFAULT;
     }
-    if (ret == EFAULT) {
+    if (ret == -EFAULT) {
       cerr << "Corrupt input for import" << std::endl;
     }
     if (ret == 0)