From: Loic Dachary Date: Fri, 12 Sep 2014 15:36:35 +0000 (+0200) Subject: erasure-code: fix erasure_code_benchmark goop (decode) X-Git-Tag: v0.86~73^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2472%2Fhead;p=ceph.git erasure-code: fix erasure_code_benchmark goop (decode) 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. That was done for the encode function but not the decode function. http://tracker.ceph.com/issues/9429 Fixes: #9429 Signed-off-by: Loic Dachary --- diff --git a/src/test/erasure-code/ceph_erasure_code_benchmark.cc b/src/test/erasure-code/ceph_erasure_code_benchmark.cc index 84bd7daa917e..c6a4228bdc1e 100644 --- a/src/test/erasure-code/ceph_erasure_code_benchmark.cc +++ b/src/test/erasure-code/ceph_erasure_code_benchmark.cc @@ -164,9 +164,12 @@ int ErasureCodeBench::decode() { 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());