]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
scratchtoolpp.cc: print some more results
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 13 Feb 2013 17:53:20 +0000 (18:53 +0100)
committerGreg Farnum <greg@inktank.com>
Thu, 14 Feb 2013 18:27:40 +0000 (10:27 -0800)
Print some more results to fix issue found by cppcheck:

[src/scratchtoolpp.cc:111] -> [src/scratchtoolpp.cc:114]:
  (performance) Variable 'r' is reassigned a value before
  the old one has been used.
[src/scratchtoolpp.cc:207] -> [src/scratchtoolpp.cc:208]:
  (performance) Variable 'r' is reassigned a value before
  the old one has been used.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/scratchtoolpp.cc

index 01db29e9f2b522b3a6aba14887a1e2a46b892c51..62096920300bcaa727d16a8a3a33e137ee2d78f6 100644 (file)
@@ -109,7 +109,7 @@ int main(int argc, const char **argv)
   uint64_t stat_size;
   time_t stat_mtime;
   r = io_ctx.stat(oid, &stat_size, &stat_mtime);
-  cout << "io_ctx.stat size = " << stat_size << " mtime = " << stat_mtime << std::endl;
+  cout << "io_ctx.stat returned " << r << " size = " << stat_size << " mtime = " << stat_mtime << std::endl;
 
   r = io_ctx.stat(oid, NULL, NULL);
   cout << "io_ctx.stat(does_not_exist) = " << r;
@@ -205,8 +205,9 @@ int main(int argc, const char **argv)
   cout << "sha1 result=" << sha1_str << std::endl;
 
   r = io_ctx.exec(oid, "acl", "set", bl, bl2);
+  cout << "exec (set) returned " << r << std::endl;
   r = io_ctx.exec(oid, "acl", "get", bl, bl2);
-  cout << "exec returned " << r << std::endl;
+  cout << "exec (get) returned " << r << std::endl;
   if (bl2.length() > 0) {
     cout << "attr=" << bl2.c_str() << std::endl;
   }