summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd.c
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2010-12-16 01:24:33 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-12-27 20:50:55 -0800
commit953f89d82f2c444719ba3150c9890c072a2e7fb3 (patch)
treeb5756f8638ae9b93cf77a141d08184ecb94928a5 /cli/src/cli-cmd.c
parente7512cbb171856a925b7db938da423b493339b00 (diff)
glusterd,cli: print single error message on failure
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1922 (Volume not present wrong message displayed on command line) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1922
Diffstat (limited to 'cli/src/cli-cmd.c')
-rw-r--r--cli/src/cli-cmd.c35
1 files changed, 33 insertions, 2 deletions
diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c
index f09c62106..2b9aea191 100644
--- a/cli/src/cli-cmd.c
+++ b/cli/src/cli-cmd.c
@@ -60,6 +60,38 @@ cli_cmd_needs_connection (struct cli_cmd_word *word)
}
int
+cli_cmd_status_reset (void)
+{
+ int ret = 0;
+
+ ret = cli_cmd_lock ();
+ {
+ if (ret == 0) {
+ cmd_sent = 0;
+ cmd_done = 0;
+ }
+ }
+ ret = cli_cmd_unlock ();
+ return ret;
+
+}
+
+int
+cli_cmd_sent_status_get (int *status)
+{
+ int ret = 0;
+ GF_ASSERT (status);
+
+ ret = cli_cmd_lock ();
+ {
+ if (ret == 0)
+ *status = cmd_sent;
+ }
+ ret = cli_cmd_unlock ();
+ return ret;
+}
+
+int
cli_cmd_process (struct cli_state *state, int argc, char **argv)
{
int ret = 0;
@@ -112,11 +144,10 @@ cli_cmd_process (struct cli_state *state, int argc, char **argv)
callback:
ret = word->cbkfn (state, word, (const char **)argv, argc);
-
+ (void) cli_cmd_status_reset ();
return ret;
}
-
int
cli_cmd_input_token_count (const char *text)
{