summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-05-25 05:14:25 +0000
committerAnand Avati <avati@gluster.com>2011-05-31 10:01:31 -0700
commit5f1c41d9088272617fd1afeccd679abdb5f36a3f (patch)
tree49dfa1eeb8e999d50c1f878dd6572d6f16f15c1f /cli
parentd150340907efe888cdabfd4e49552fa8c75f2445 (diff)
cli: bring in format checking option for 'cli_out()'
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2944 (warnings in cli_out) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2944
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli.c2
-rw-r--r--cli/src/cli.h10
2 files changed, 10 insertions, 2 deletions
diff --git a/cli/src/cli.c b/cli/src/cli.c
index 93fcd620431..491c11b4434 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -468,7 +468,7 @@ cli_usage_out (const char *usage)
}
int
-cli_out (const char *fmt, ...)
+_cli_out (const char *fmt, ...)
{
struct cli_state *state = NULL;
va_list ap;
diff --git a/cli/src/cli.h b/cli/src/cli.h
index c81ae47e5cd..36e9e2134aa 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -166,7 +166,15 @@ int cli_rl_enable (struct cli_state *state);
int cli_rl_out (struct cli_state *state, const char *fmt, va_list ap);
int cli_usage_out (const char *usage);
-int cli_out (const char *fmt, ...);
+
+int _cli_out (const char *fmt, ...);
+
+#define cli_out(fmt...) do { \
+ FMT_WARN (fmt); \
+ \
+ _cli_out(fmt); \
+ \
+ } while (0)
int
cli_submit_request (void *req, call_frame_t *frame,