From: John Spray Date: Mon, 20 Apr 2015 16:28:15 +0000 (+0100) Subject: tools: clean up errors in ceph-objectstore-tool X-Git-Tag: v0.94.7~28^2~9^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ca2f35d02169e6f82e3d45e00fe880c02cbd8ce;p=ceph.git tools: clean up errors in ceph-objectstore-tool 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 (cherry picked from commit 8e5594da29e782b6efd046ed03f313599dafa1c5) Conflicts: src/tools/RadosDump.cc (Excluded, not in Hammer) --- diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 639196196635..396964f295e4 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -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)