From 9ca2f35d02169e6f82e3d45e00fe880c02cbd8ce Mon Sep 17 00:00:00 2001 From: John Spray Date: Mon, 20 Apr 2015 17:28:15 +0100 Subject: [PATCH] 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) --- src/tools/ceph_objectstore_tool.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 63919619663..396964f295e 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) -- 2.47.3