From: David Zafman Date: Thu, 16 Feb 2017 00:17:32 +0000 (-0800) Subject: ceph-osdomap-tool: Fix seg fault with large amount of check error output X-Git-Tag: v12.0.2~296^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1dda0411f4fbb14ce1e0062da9f14ec3af505d39;p=ceph-ci.git ceph-osdomap-tool: Fix seg fault with large amount of check error output Signed-off-by: David Zafman --- diff --git a/src/tools/ceph_osdomap_tool.cc b/src/tools/ceph_osdomap_tool.cc index 1e18c237d09..0ac44105253 100644 --- a/src/tools/ceph_osdomap_tool.cc +++ b/src/tools/ceph_osdomap_tool.cc @@ -161,9 +161,11 @@ int main(int argc, char **argv) { } } } else if (cmd == "check" || cmd == "repair") { + ostringstream ss; bool repair = (cmd == "repair"); - r = omap.check(std::cout, repair); + r = omap.check(ss, repair); if (r > 0) { + std::cerr << ss.str() << std::endl; std::cerr << "check got " << r << " error(s)" << std::endl; r = 1; goto done;