summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-04-23 11:11:43 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-25 00:45:51 -0700
commit3f35280a364bd35293d3e5804eb2a659a7f174b1 (patch)
treee400432d3460aaacbdc4e6675978bd1c2c94e4ef /cli/src/cli-rpc-ops.c
parent90d5d569b5a2333094ba8741bb29fe040b695b23 (diff)
cli: implement a fn 'cli_err()' to send error messages to 'stderr'
we were using 'cli_out()' to send all the possible msgs, which is not very friendly with scripts, because if one want to get only valid output with "<command> 2>/error.log 1>/proper-info.log" Change-Id: I008ebcbd90935c41dbfc1bd2adeb094ed21116cb Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 815194 Reviewed-on: http://review.gluster.com/3208 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 790330240fd..9487badb6f1 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -183,7 +183,11 @@ gf_cli3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
goto out;
}
#endif
- cli_out ("%s", msg);
+ if (!rsp.op_ret)
+ cli_out ("%s", msg);
+ else
+ cli_err ("%s", msg);
+
ret = rsp.op_ret;
out:
@@ -256,7 +260,11 @@ gf_cli3_1_deprobe_cbk (struct rpc_req *req, struct iovec *iov,
goto out;
}
#endif
- cli_out ("%s", msg);
+ if (!rsp.op_ret)
+ cli_out ("%s", msg);
+ else
+ cli_err ("%s", msg);
+
ret = rsp.op_ret;
out: