mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
98bc781b42
commit
66aa7e02c6
16
tools/vsh.c
16
tools/vsh.c
|
@ -3457,11 +3457,12 @@ const vshCmdInfo info_complete[] = {
|
||||||
{.name = NULL}
|
{.name = NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WITH_READLINE
|
||||||
bool
|
bool
|
||||||
cmdComplete(vshControl *ctl, const vshCmd *cmd)
|
cmdComplete(vshControl *ctl, const vshCmd *cmd)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
#ifdef WITH_READLINE
|
|
||||||
const vshClientHooks *hooks = ctl->hooks;
|
const vshClientHooks *hooks = ctl->hooks;
|
||||||
int stdin_fileno = STDIN_FILENO;
|
int stdin_fileno = STDIN_FILENO;
|
||||||
const char *arg = "";
|
const char *arg = "";
|
||||||
|
@ -3510,6 +3511,17 @@ cmdComplete(vshControl *ctl, const vshCmd *cmd)
|
||||||
cleanup:
|
cleanup:
|
||||||
virBufferFreeAndReset(&buf);
|
virBufferFreeAndReset(&buf);
|
||||||
virStringListFree(matches);
|
virStringListFree(matches);
|
||||||
#endif /* WITH_READLINE */
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#else /* !WITH_READLINE */
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
cmdComplete(vshControl *ctl ATTRIBUTE_UNUSED,
|
||||||
|
const vshCmd *cmd ATTRIBUTE_UNUSED)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
#endif /* !WITH_READLINE */
|
||||||
|
|
Loading…
Reference in New Issue