diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-replace-brick.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-replace-brick.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c index 3b8483847e4..b1266aa032e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-replace-brick.c +++ b/xlators/mgmt/glusterd/src/glusterd-replace-brick.c @@ -194,7 +194,6 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr, xlator_t *this = NULL; gf_boolean_t is_force = _gf_false; gsync_status_param_t param = {0,}; - char *c = NULL; this = THIS; GF_ASSERT (this); @@ -346,18 +345,8 @@ glusterd_op_stage_replace_brick (dict_t *dict, char **op_errstr, GD_MSG_NO_MEMORY, "Memory allocation failed"); goto out; } - - /* - * IPv4 address contains '.' and ipv6 addresses contains ':' - * So finding the last occurance of ':' to - * mark the start of brick path - */ - c = strrchr(dup_dstbrick, ':'); - if (c != NULL) { - c[0] = '\0'; - host = dup_dstbrick; - path = c++; - } + host = strtok_r (dup_dstbrick, ":", &savetok); + path = strtok_r (NULL, ":", &savetok); if (!host || !path) { gf_msg (this->name, GF_LOG_ERROR, 0, |