diff mbox series

[v4,11/12] multipathd: fix incompatible pointer type error with libedit

Message ID 20220830192713.19778-12-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series Split libmultipath and libmpathutil | expand

Commit Message

Martin Wilck Aug. 30, 2022, 7:27 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

Versions of libedit prior to 2016 were using a wrong prototype for
rl_completion_entry_function in readline.h. Internally, libedit casts this to
the correct type (char *)(*)(const char *, int) (aka CPFunction in libedit).
So we simply cast to the wrong prototype here.

See http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/readline/readline.h.diff?r1=1.34&r2=1.35

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
---
 multipathd/Makefile | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/multipathd/Makefile b/multipathd/Makefile
index 8a56304..28ebdc0 100644
--- a/multipathd/Makefile
+++ b/multipathd/Makefile
@@ -34,6 +34,10 @@  endif
 ifeq ($(READLINE),libreadline)
 RL_CPPFLAGS += -DUSE_LIBREADLINE
 RL_LIBDEPS += -lreadline
+# See comment in uxclnt.c
+ifeq ($(shell sed -En 's/.*\<Function\s*\*rl_completion_entry_function;.*/yes/p' /usr/include/editline/readline.h),yes)
+RL_CPPFLAGS += -DBROKEN_RL_COMPLETION_FUNC
+endif
 endif
 
 ifdef SYSTEMD