From a7795fedd4ee2ed7de2dce89fd782ae20b03f6a4 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Mon, 26 Jul 2010 12:10:08 +0000 Subject: cli: Changes to provide proper exit status for gluster commandline Signed-off-by: Vijay Bellur Signed-off-by: Anand V. Avati BUG: 1205 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1205 --- cli/src/cli3_1-cops.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'cli/src/cli3_1-cops.c') diff --git a/cli/src/cli3_1-cops.c b/cli/src/cli3_1-cops.c index 6ebe6ddbe40..8e6c76ae688 100644 --- a/cli/src/cli3_1-cops.c +++ b/cli/src/cli3_1-cops.c @@ -33,6 +33,7 @@ #include "protocol-common.h" extern rpc_clnt_prog_t *cli_rpc_prog; +extern int cli_op_ret; int gf_cli3_1_probe_cbk (struct rpc_req *req, struct iovec *iov, @@ -60,7 +61,7 @@ gf_cli3_1_probe_cbk (struct rpc_req *req, struct iovec *iov, ret = rsp.op_ret; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); return ret; } @@ -90,7 +91,7 @@ gf_cli3_1_deprobe_cbk (struct rpc_req *req, struct iovec *iov, ret = rsp.op_ret; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); return ret; } @@ -191,7 +192,7 @@ gf_cli3_1_list_friends_cbk (struct rpc_req *req, struct iovec *iov, ret = 0; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); if (ret) cli_out ("Command Execution Failed"); @@ -299,7 +300,7 @@ gf_cli3_1_get_volume_cbk (struct rpc_req *req, struct iovec *iov, ret = 0; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); if (ret) cli_out ("Command Execution Failed"); @@ -341,7 +342,7 @@ gf_cli3_1_create_volume_cbk (struct rpc_req *req, struct iovec *iov, ret = rsp.op_ret; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); return ret; } @@ -379,7 +380,7 @@ gf_cli3_1_delete_volume_cbk (struct rpc_req *req, struct iovec *iov, ret = rsp.op_ret; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); gf_log ("", GF_LOG_NORMAL, "Returning with %d", ret); return ret; } @@ -419,7 +420,7 @@ gf_cli3_1_start_volume_cbk (struct rpc_req *req, struct iovec *iov, ret = rsp.op_ret; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); return ret; } @@ -458,7 +459,7 @@ gf_cli3_1_stop_volume_cbk (struct rpc_req *req, struct iovec *iov, ret = rsp.op_ret; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); return ret; } @@ -497,7 +498,7 @@ gf_cli3_1_defrag_volume_cbk (struct rpc_req *req, struct iovec *iov, ret = rsp.op_ret; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); return ret; } @@ -582,7 +583,7 @@ gf_cli3_1_add_brick_cbk (struct rpc_req *req, struct iovec *iov, ret = rsp.op_ret; out: - cli_cmd_broadcast_response (); + cli_cmd_broadcast_response (ret); return ret; } -- cgit