summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2011-07-05 23:08:40 +0000
committerAnand Avati <avati@gluster.com>2011-07-11 04:07:53 -0700
commita879613637f54a7a2016549b308b359b7577b5ad (patch)
treeaa9de34d1905634a3fcbfa1a3b8005268de86f29 /cli/src/cli-cmd.c
parent8f14d85777c93277403bcac727c0447dcba3cdc0 (diff)
cli: Exit if glusterd is not operational in non-prompt modes
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 3120 (Provide connection timeout between cli and glusterd) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3120
Diffstat (limited to 'cli/src/cli-cmd.c')
-rw-r--r--cli/src/cli-cmd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/src/cli-cmd.c b/cli/src/cli-cmd.c
index cb0199b0664..1d98ecc7a36 100644
--- a/cli/src/cli-cmd.c
+++ b/cli/src/cli-cmd.c
@@ -132,7 +132,9 @@ cli_cmd_process (struct cli_state *state, int argc, char **argv)
if ( strcmp (word->word,"help")==0 )
goto callback;
- ret = cli_cmd_await_connected (cli_cmd_needs_connection (word));
+ state->await_connected = cli_cmd_needs_connection (word);
+
+ ret = cli_cmd_await_connected (state->await_connected);
if (ret) {
cli_out ("Connection failed. Please check if gluster "
"daemon is operational.");