From 66aa7e02c69cd90995f29dbfaca6c659ffe11693 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Sun, 14 Jan 2018 11:43:51 +0100 Subject: [PATCH] vsh: Provide cmdComplete stub for readline disabled builds When building without readline, this function does nothing but return false. Without touching any of its arguments which triggers a build error. Therefore, provide a stub that has arguments marked as unused. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- tools/vsh.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/tools/vsh.c b/tools/vsh.c index a99d47bfc2..058df7ef6f 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -3457,11 +3457,12 @@ const vshCmdInfo info_complete[] = { {.name = NULL} }; + +#ifdef WITH_READLINE bool cmdComplete(vshControl *ctl, const vshCmd *cmd) { bool ret = false; -#ifdef WITH_READLINE const vshClientHooks *hooks = ctl->hooks; int stdin_fileno = STDIN_FILENO; const char *arg = ""; @@ -3510,6 +3511,17 @@ cmdComplete(vshControl *ctl, const vshCmd *cmd) cleanup: virBufferFreeAndReset(&buf); virStringListFree(matches); -#endif /* WITH_READLINE */ return ret; } + + +#else /* !WITH_READLINE */ + + +bool +cmdComplete(vshControl *ctl ATTRIBUTE_UNUSED, + const vshCmd *cmd ATTRIBUTE_UNUSED) +{ + return false; +} +#endif /* !WITH_READLINE */