]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
erasure-code: fix erasure_code_benchmark goop 2464/head
authorLoic Dachary <loic-201408@dachary.org>
Thu, 11 Sep 2014 20:07:33 +0000 (22:07 +0200)
committerLoic Dachary <loic-201408@dachary.org>
Thu, 11 Sep 2014 20:24:53 +0000 (22:24 +0200)
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 <loic-201408@dachary.org>
src/test/erasure-code/ceph_erasure_code_benchmark.cc

index 008e4331abb15b11d9e301aeb136c9eed7cf90ef..84bd7daa917e54a6652864eb6761454acd8faaaa 100644 (file)
@@ -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());