diff options
author | Kaushal M <kaushal@redhat.com> | 2012-05-03 10:43:38 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-05-18 19:44:11 -0700 |
commit | feb99ca3081f838faf9fd9cebfabab8d4c9d015c (patch) | |
tree | ef5e208a55485959ff5a9eefb81c0558a4619565 /xlators/mgmt/glusterd/src/glusterd-utils.c | |
parent | 4aa7bc40c9f129d6bea738941dea5b95b80d58e9 (diff) |
glusterd, cli: Enable errstr for peer probe
Presently glusterd only returns an errno to cli for peer probe command. This
patch allows glusterd to return an errstr as well to cli. An op_errstr member
has been added to gf1_cli_probe_rsp and gd1_mgmt_probe_rsp structs to allow
this.
In case of an error, cli will display the errstr if it was set. If errstr is not
set cli will display the error message based on errno.
Also, to allow for return of errstr in cases such as handshake failure, an
errstr member has been added to the glusterd_peerctx_t struct.
Change-Id: Iece2b44a7181555e960d9fe4517ec6cda4cdb385
BUG: 816840
Signed-off-by: Kaushal M <kaushal@redhat.com>
Reviewed-on: http://review.gluster.com/3262
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amarts@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index f04792c7b9a..ea0ee68e680 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -911,8 +911,11 @@ glusterd_friend_cleanup (glusterd_peerinfo_t *peerinfo) peerinfo->rpc->mydata = NULL; peerinfo->rpc = rpc_clnt_unref (peerinfo->rpc); peerinfo->rpc = NULL; - if (peerctx) + if (peerctx) { + if (peerctx->errstr) + GF_FREE (peerctx->errstr); GF_FREE (peerctx); + } } glusterd_peer_destroy (peerinfo); |