]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: avoid noise when there is no output
authorSage Weil <sage@newdream.net>
Thu, 8 Sep 2011 19:48:00 +0000 (12:48 -0700)
committerSage Weil <sage@newdream.net>
Thu, 8 Sep 2011 22:05:16 +0000 (15:05 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/tools/ceph.cc

index 18dc7d445cbde226c7ecc70d878420428080c52b..62ed1181cb3f85b8bc0c9c7ba3b75945025d9390 100644 (file)
@@ -188,13 +188,15 @@ int main(int argc, const char **argv)
          bufferlist obl;
          if (ceph_tool_do_command(ctx, cmd, indata, obl))
            ret = 1;
-         int err = obl.write_fd(out_fd);
-         if (err) {
-           derr << " failed to write " << obl.length() << " bytes to " << out_file << ": "
-                << cpp_strerror(err) << dendl;
-           goto out;
+         if (obl.length()) {
+           int err = obl.write_fd(out_fd);
+           if (err) {
+             derr << " failed to write " << obl.length() << " bytes to " << out_file << ": "
+                  << cpp_strerror(err) << dendl;
+             goto out;
+           }
+           derr << " wrote " << obl.length() << " byte payload to " << out_file << dendl;
          }
-         derr << " wrote " << obl.length() << " byte payload to " << out_file << dendl;
        }
       }
       if (ceph_tool_messenger_shutdown())