summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-05-26 05:45:07 +0000
committerAnand Avati <avati@gluster.com>2011-05-27 00:19:15 -0700
commit4c1c8feee4afd6cabeabc17c85bbc7634adb683f (patch)
treee6c7ebbba578dda3ec0ec8186565ac1f544ab586
parent7dc5a648caee92ce6d62bbe7b4dc1406662c3858 (diff)
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 <shishirng@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> 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
-rw-r--r--cli/src/cli-rpc-ops.c2
1 files changed, 1 insertions, 1 deletions
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);