From 4c1c8feee4afd6cabeabc17c85bbc7634adb683f Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Thu, 26 May 2011 05:45:07 +0000 Subject: TOP: exit status should be non-zero for success The fault was incorrect loop. An extra iteration was being performed, and dict_get failed due to non-existant data leading to status being set to non-zero Signed-off-by: shishir gowda Signed-off-by: Anand Avati BUG: 2882 (Make volume top command exit status as zero on success) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2882 --- cli/src/cli-rpc-ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index ee52ccc95..4e3ae1ab5 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -3286,7 +3286,7 @@ gf_cli3_1_top_volume_cbk (struct rpc_req *req, struct iovec *iov, ret = dict_get_int32 (dict, key, (int32_t*)&top_op); if (ret) goto out; - while (i <= brick_count) { + while (i < brick_count) { i++; snprintf (brick, sizeof (brick), "%d-brick", i); ret = dict_get_str (dict, brick, &bricks); -- cgit