From 0bb928264a9fb100dc927687eed6ad4d22675950 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Wed, 25 Oct 2017 14:36:35 +0200 Subject: Make sure attach_brick return a proper error code Coverity warn about "Using uninitialized value "ret".", which is indeed the case. If we can't attach after 15 tries, attach_brick return uninitiliazed return code, which is likely hard to trigger, but bad. I use -1 to follow the UNIX convetion, but there is no specific error code tested by code. Change-Id: I43ad60d25ab169f9cea0db600805ced7f77c37ba BUG: 789278 Signed-off-by: Michael Scherer --- xlators/mgmt/glusterd/src/glusterd-utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 22f5865007f..52ebbc2638f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -5401,7 +5401,7 @@ attach_brick (xlator_t *this, char unslashed[PATH_MAX] = {'\0',}; char full_id[PATH_MAX] = {'\0',}; char path[PATH_MAX] = {'\0',}; - int ret; + int ret = -1; int tries; rpc_clnt_t *rpc; -- cgit