]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
vsh: Provide cmdComplete stub for readline disabled builds
authorMichal Privoznik <mprivozn@redhat.com>
Sun, 14 Jan 2018 10:43:51 +0000 (11:43 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Jan 2018 14:49:07 +0000 (15:49 +0100)
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>
tools/vsh.c

index a99d47bfc264d445a798a20f3c7498f5ab44b051..058df7ef6f4aa429e78621dea3951cad2bce9d71 100644 (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 */