summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorNigel Babu <nigelb@redhat.com>2017-02-23 15:13:43 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-02-25 07:29:41 -0500
commitdc15855cea679affd78d28fd94cbea0c108997f0 (patch)
tree3f2e8ec8c04a108a313c603f2f7053ef1eca0916 /cli
parentff2ba49d02dc99b0c3de5712348ae9d588be7ad7 (diff)
cli: fix error when HAVE_READLINE is false
When HAVE_READLINE is false, Gluster doesn't compile with -Werror flag. This will fix it up so it is possible to compile without having readline present Change-Id: Ia6620b5a372318d10f0e908e3d45f4090f99d118 BUG: 1426052 Reviewed-on: https://review.gluster.org/16734 Smoke: Gluster Build System <jenkins@build.gluster.org> Tested-by: Nigel Babu <nigelb@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/cli/src/cli.c b/cli/src/cli.c
index 1710724..5f0441f 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -517,11 +517,11 @@ cli_usage_out (const char *usage)
int
_cli_err (const char *fmt, ...)
{
- struct cli_state *state = NULL;
va_list ap;
int ret = 0;
-
- state = global_state;
+#ifdef HAVE_READLINE
+ struct cli_state *state = global_state;
+#endif
va_start (ap, fmt);
@@ -543,14 +543,13 @@ _cli_err (const char *fmt, ...)
int
_cli_out (const char *fmt, ...)
{
- struct cli_state *state = NULL;
va_list ap;
int ret = 0;
-
- state = global_state;
+#ifdef HAVE_READLINE
+ struct cli_state *state = global_state;
+#endif
va_start (ap, fmt);
-
#ifdef HAVE_READLINE
if (state->rl_enabled && !state->rl_processing) {
va_end (ap);