From 85763f09fe0ad1f295457fdfd5ac3c4b405821f4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 18 Dec 2012 19:21:24 -0800 Subject: [PATCH] ceph: report error string to stderr, not stdout If we return an error, send the message to stderr. This makes things more easily scriptable because error messages won't take the place of expected output. Signed-off-by: Sage Weil --- src/tools/common.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tools/common.cc b/src/tools/common.cc index 9679f08834ede..9a3763a34aeaf 100644 --- a/src/tools/common.cc +++ b/src/tools/common.cc @@ -294,8 +294,12 @@ int do_command(CephToolCtx *ctx, << reply_from.name << " -> '" << reply_rs << "' (" << reply_rc << ")" << std::endl; - else - cout << reply_rs << std::endl; + else { + if (reply_rc >= 0) + cout << reply_rs << std::endl; + else + cerr << reply_rs << std::endl; + } return reply_rc; } -- 2.39.5