From dc15855cea679affd78d28fd94cbea0c108997f0 Mon Sep 17 00:00:00 2001 From: Nigel Babu Date: Thu, 23 Feb 2017 15:13:43 +0530 Subject: 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 Tested-by: Nigel Babu NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Reviewed-by: Atin Mukherjee --- cli/src/cli.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cli/src/cli.c b/cli/src/cli.c index 1710724abd6..5f0441fdf98 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); -- cgit