Skip to contentSkip to conversation

multipath-tools: fix do_compile failure due to json-c upgrade

PATCH Chen Qi 1 participant 1 message Jun 9, 2020 1 message not in the archive

lore
Share & tools
lore

Chen Qi

author
#1 lore raw
In reply to a message not in the archive

Just noticed Khem has sent a similar patch. Ignore this one please.

Quoted 62 lines · Chen Qi

The new json-c does not define TRUE, so we should use 1 to avoid do_compile failure.

---
  ...01-libdmmp_private.h-Do-not-use-TRUE.patch | 31 +++++++++++++++++++
  .../multipath-tools/multipath-tools_0.8.4.bb  |  1 +
  2 files changed, 32 insertions(+)

create mode 100644 meta-oe/recipes-support/multipath-tools/files/0001-libdmmp_private.h-Do-not-use-TRUE.patch

meta-oe/recipes-support/multipath-tools/files/0001-libdmmp_private.h-Do-not-use-TRUE.patch new file +31 -0
new file mode 100644
index 000000000..a78bfd2c6
@@ -0,0 +1,31 @@
+From cdee4a7e9f8aa880eb4f381aa4325c1ae42951f8 Mon Sep 17 00:00:00 2001
+From: Chen Qi <[email protected]>
+Date: Mon, 8 Jun 2020 18:43:10 -0700
+Subject: [PATCH] libdmmp_private.h: Do not use TRUE
+
+As json-c has been upgraded and TRUE is not defined any more, we should
+avoid using it and use 1 instead.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ libdmmp/libdmmp_private.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libdmmp/libdmmp_private.h b/libdmmp/libdmmp_private.h
+index ac85b63f..4378962b 100644
+--- a/libdmmp/libdmmp_private.h
++++ b/libdmmp/libdmmp_private.h
+@@ -82,7 +82,7 @@ static out_type func_name(struct dmmp_context *ctx, const char *var_name) { \
+ do { \
+ 	json_type j_type = json_type_null; \
+ 	json_object *j_obj_tmp = NULL; \
+-	if (json_object_object_get_ex(j_obj, key, &j_obj_tmp) != TRUE) { \
++	if (json_object_object_get_ex(j_obj, key, &j_obj_tmp) != 1) { \
+ 		_error(ctx, "Invalid JSON output from multipathd IPC: " \
+ 		       "key '%s' not found", key); \
+ 		rc = DMMP_ERR_IPC_ERROR; \
+--
+2.21.0
+
meta-oe/recipes-support/multipath-tools/multipath-tools_0.8.4.bb +1 -0
index af34a4b39..5018f51d2 100644
@@ -45,6 +45,7 @@ SRC_URI = "git://git.opensvc.com/multipath-tools/.git;protocol=http \
             file://0031-Always-use-devmapper-for-kpartx.patch \
             file://0001-fix-bug-of-do_compile-and-do_install.patch \
             file://0001-add-explicit-dependency-on-libraries.patch \
+           file://0001-libdmmp_private.h-Do-not-use-TRUE.patch \
             "
 
  LIC_FILES_CHKSUM = "file://COPYING;md5=5f30f0716dfdd0d91eb439ebec522ec2"