diff options
author | Michael Scherer <misc@redhat.com> | 2017-10-25 14:36:35 +0200 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-10-26 14:30:40 +0000 |
commit | 0bb928264a9fb100dc927687eed6ad4d22675950 (patch) | |
tree | 36ee150a16f150d336e520cff743fba6ebb3b4ee /xlators/mgmt/glusterd | |
parent | 63160cb952fe7716a3313ce5ee32f890fe4d7a0c (diff) |
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 <misc@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |