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 <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Michal Privoznik 2018-01-14 11:43:51 +01:00
parent 98bc781b42
commit 66aa7e02c6
1 changed files with 14 additions and 2 deletions

View File

@ -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 */