summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2016-08-22 13:22:02 -0400
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-09-12 23:06:39 -0700
commit4903dbaffd1c1ee99889a3f21ac83950cc9a1c4e (patch)
tree32f0c6435def18d63d910b73b28a8ca43ebe9ebe /xlators/mgmt/glusterd/src/glusterd-geo-rep.c
parent57a65381282160f414ce59133007374f14337f9c (diff)
glusterd (geo-rep): fix unused variable warnings/errors
http://review.gluster.org/14085 fixes a/the "leak" - via the generated rpc/xdr headers - of pragmas that mask these warnings. However 14085 won't pass the smoke test until all the warnings are fixed. Change-Id: I2edacd3d0f3924b1be0f0398ba9ac076459c5a61 BUG: 1369124 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com> Reviewed-on: http://review.gluster.org/15263 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-geo-rep.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 67f27712f86..2ddaf0d411c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -1349,7 +1349,6 @@ static int
_get_slave_idx_slave_voluuid (dict_t *dict, char *key, data_t *value,
void *data)
{
- char *slave_voluuid = NULL;
char *slave_info = NULL;
xlator_t *this = NULL;
struct slave_vol_config *slave_cfg = NULL;
@@ -2867,10 +2866,8 @@ out:
static int
get_slavehost_from_voluuid (dict_t *dict, char *key, data_t *value, void *data)
{
- char *slave_voluuid = NULL;
char *slave_info = NULL;
char *tmp = NULL;
- char tmp_char = 0;
char *slave_host = NULL;
xlator_t *this = NULL;
struct slave_vol_config *slave_vol = NULL;
@@ -3000,13 +2997,10 @@ glusterd_op_stage_gsync_create (dict_t *dict, char **op_errstr)
glusterd_volinfo_t *volinfo = NULL;
struct stat stbuf = {0,};
xlator_t *this = NULL;
- char *georep_session_wrkng_dir = NULL;
struct slave_vol_config slave1 = {{0},};
- int type = 0;
char old_slave_url[SLAVE_URL_INFO_MAX] = {0};
char old_confpath[PATH_MAX] = {0};
gf_boolean_t is_running = _gf_false;
- int ret_status = 0;
char *statedir = NULL;
char statefiledir[PATH_MAX] = {0,};
gf_boolean_t is_different_slavehost = _gf_false;
@@ -3687,7 +3681,7 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr)
pfd = gsyncd_getpidfile (volname, slave, pidfile,
conf_path, &is_template_in_use);
- if (is_template_in_use) {
+ if (is_template_in_use || pfd == -1) {
snprintf (errmsg, sizeof(errmsg), "pid-file entry "
"missing in the config file(%s).",
conf_path);
@@ -3742,6 +3736,9 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr)
}
out:
+ if (pfd != -1)
+ sys_close (pfd);
+
if (path_list)
GF_FREE (path_list);
@@ -3766,7 +3763,6 @@ gd_pause_or_resume_gsync (dict_t *dict, char *master, char *slave,
char pidfile[PATH_MAX] = {0,};
char errmsg[PATH_MAX] = "";
char buf [1024] = {0,};
- int i = 0;
gf_boolean_t is_template_in_use = _gf_false;
char monitor_status[NAME_MAX] = {0,};
char *statefile = NULL;
@@ -4401,13 +4397,10 @@ int
glusterd_read_status_file (glusterd_volinfo_t *volinfo, char *slave,
char *conf_path, dict_t *dict, char *node)
{
- char brick_state_file[PATH_MAX] = "";
- char brick_path[PATH_MAX] = "";
char temp_conf_path[PATH_MAX] = "";
char *working_conf_path = NULL;
char *georep_session_wrkng_dir = NULL;
char *master = NULL;
- char tmp[1024] = "";
char sts_val_name[1024] = "";
char monitor_status[NAME_MAX] = "";
char *statefile = NULL;
@@ -4422,14 +4415,12 @@ glusterd_read_status_file (glusterd_volinfo_t *volinfo, char *slave,
char *brick_host_uuid = NULL;
int brick_host_uuid_length = 0;
int gsync_count = 0;
- int i = 0;
int ret = 0;
glusterd_brickinfo_t *brickinfo = NULL;
gf_gsync_status_t *sts_val = NULL;
gf_boolean_t is_template_in_use = _gf_false;
glusterd_conf_t *priv = NULL;
struct stat stbuf = {0,};
- dict_t *statusd = NULL;
xlator_t *this = NULL;
this = THIS;
@@ -4840,7 +4831,6 @@ glusterd_get_gsync_status_mst_slv (glusterd_volinfo_t *volinfo,
{
char *statefile = NULL;
uuid_t uuid = {0, };
- glusterd_conf_t *priv = NULL;
int ret = 0;
gf_boolean_t is_template_in_use = _gf_false;
struct stat stbuf = {0, };
@@ -4853,8 +4843,6 @@ glusterd_get_gsync_status_mst_slv (glusterd_volinfo_t *volinfo,
GF_ASSERT (slave);
GF_ASSERT (this->private);
- priv = this->private;
-
ret = glusterd_gsync_get_uuid (slave, volinfo, uuid);
if (ret) {
gf_msg (this->name, GF_LOG_INFO, 0, GD_MSG_SESSION_INACTIVE,
@@ -5484,7 +5472,6 @@ glusterd_op_gsync_set (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
char *status_msg = NULL;
gf_boolean_t is_running = _gf_false;
char *conf_path = NULL;
- char errmsg[PATH_MAX] = "";
char *key = NULL;
xlator_t *this = NULL;
@@ -6272,7 +6259,6 @@ glusterd_op_gsync_create (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
xlator_t *this = NULL;
char old_working_dir[PATH_MAX] = {0};
char new_working_dir[PATH_MAX] = {0};
- char *slave_info = NULL;
char *slave_voluuid = NULL;
char *old_slavehost = NULL;
gf_boolean_t is_existing_session = _gf_false;