From b7bdb93ff7e7d08450553927cbeed0857bcfaba7 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Thu, 11 Sep 2014 22:07:33 +0200 Subject: [PATCH] erasure-code: fix erasure_code_benchmark goop Using a stringstream that is only displayed on error when calling the erasure code factory, instead of cerr. The user expects the output to be clean when there is no error. http://tracker.ceph.com/issues/9429 Fixes: #9429 Signed-off-by: Loic Dachary --- src/test/erasure-code/ceph_erasure_code_benchmark.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/erasure-code/ceph_erasure_code_benchmark.cc b/src/test/erasure-code/ceph_erasure_code_benchmark.cc index 008e4331abb15..84bd7daa917e5 100644 --- a/src/test/erasure-code/ceph_erasure_code_benchmark.cc +++ b/src/test/erasure-code/ceph_erasure_code_benchmark.cc @@ -124,9 +124,12 @@ int ErasureCodeBench::encode() { ErasureCodePluginRegistry &instance = ErasureCodePluginRegistry::instance(); ErasureCodeInterfaceRef erasure_code; - int code = instance.factory(plugin, parameters, &erasure_code, cerr); - if (code) + stringstream messages; + int code = instance.factory(plugin, parameters, &erasure_code, messages); + if (code) { + cerr << messages.str() << endl; return code; + } int k = atoi(parameters["k"].c_str()); int m = atoi(parameters["m"].c_str()); -- 2.47.3