summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorVenky Shankar <venky@gluster.com>2011-04-11 05:48:36 +0000
committerAnand Avati <avati@gluster.com>2011-04-11 23:50:28 -0700
commit2a6598646824da9d6a957fb5b3e4c6bb40fb6835 (patch)
tree2a432e056f4803967569f58f2d70e9c63e2ef306 /cli
parentcfd85789c44ce3f88d6bf87d7b0a47dafb8c6d57 (diff)
build fixes
Signed-off-by: Venky Shankar <venky@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2550 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2550
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-volume.c5
-rw-r--r--cli/src/cli-rpc-ops.c28
2 files changed, 19 insertions, 14 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 3f639300f2c..4fa25f92db3 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -305,7 +305,10 @@ cli_cmd_get_confirmation (struct cli_state *state, const char *question)
printf ("%s (y/n) ", question);
- fgets (answer, 4, stdin);
+ if (fgets (answer, 4, stdin) == NULL) {
+ cli_out("gluster cli read error");
+ goto out;
+ }
len = strlen (answer);
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 07cfdb0c867..b0e00f63b3e 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -1391,7 +1391,9 @@ unmount:
#else
snprintf (cmd_str, sizeof (cmd_str), "umount %s", mountdir);
#endif
- system (cmd_str);
+ ret = system (cmd_str);
+ if (ret)
+ gf_log ("cli", GF_LOG_WARNING, "error executing: %s", cmd_str);
rm_dir:
rmdir (mountdir);
out:
@@ -2580,6 +2582,7 @@ int
gf_cli3_1_gsync_get_command (gf1_cli_gsync_set_rsp rsp)
{
char cmd[PATH_MAX] = {0,};
+ int ret = -1;
if (rsp.op_ret < 0)
return 0;
@@ -2595,20 +2598,19 @@ gf_cli3_1_gsync_get_command (gf1_cli_gsync_set_rsp rsp)
" --config-get %s ",
rsp.glusterd_workdir, GSYNC_CONF,
rsp.master, rsp.slave, rsp.op_name);
- system (cmd);
- goto out;
+ ret = system (cmd);
+ /*
+ * gf_log() failure from system() ?
+ */
+ } else if (rsp.config_type == GF_GSYNC_OPTION_TYPE_CONFIG_GET_ALL) {
+ snprintf (cmd, PATH_MAX, GSYNCD_PREFIX"/gsyncd -c %s/%s "
+ "%s %s --config-get-all ",
+ rsp.glusterd_workdir, GSYNC_CONF,
+ rsp.master, rsp.slave);
+
+ ret = system (cmd);
}
- if (rsp.config_type == GF_GSYNC_OPTION_TYPE_CONFIG_GET_ALL) {
- snprintf (cmd, PATH_MAX, GSYNCD_PREFIX"/gsyncd -c %s/%s "
- "%s %s --config-get-all ",
- rsp.glusterd_workdir, GSYNC_CONF,
- rsp.master, rsp.slave);
-
- system (cmd);
- goto out;
- }
-out:
return 0;
}