From: Danny Al-Gaaf Date: Fri, 31 May 2013 20:26:17 +0000 (+0200) Subject: kv_flat_btree_async.cc: fix assigned but unused value issue X-Git-Tag: v0.65~132^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8afbc2805084aa945a6fd7a555b296f79eecc798;p=ceph.git kv_flat_btree_async.cc: fix assigned but unused value issue Fix "Variable 'r' is assigned a value that is never used." issue from cppcheck. Check return value and print warning if in verbose mode. Signed-off-by: Danny Al-Gaaf --- diff --git a/src/key_value_store/kv_flat_btree_async.cc b/src/key_value_store/kv_flat_btree_async.cc index 8573a43b6c95..68e1eab6b840 100644 --- a/src/key_value_store/kv_flat_btree_async.cc +++ b/src/key_value_store/kv_flat_btree_async.cc @@ -1371,9 +1371,13 @@ int KvFlatBtreeAsync::setup(int argc, const char** argv) { make_max_obj.setxattr("unwritable", to_bl("0")); make_max_obj.setxattr("size", to_bl("0")); r = io_ctx.operate(client_name, &make_max_obj); + if (r < 0) { + if (verbose) cout << client_name << ": Setting xattr failed with code " + << r + << std::endl; + } return 0; - } int KvFlatBtreeAsync::set(const string &key, const bufferlist &val,