rsyslog/rsyslog-8.4.0-json-c-0.12.patch

35 lines
1.3 KiB
Diff

From: Rainer Gerhards <rgerhards@adiscon.com>
Date: Tue Aug 19 11:33:41 2014 +0200
Subject: build failure on systems which don't have json_tokener_errors
Upstream: Committed
References: https://github.com/rsyslog/rsyslog/commit/6b47dd542d07ed557f02af9970d1004eb262e1c1
bugfix: build failure on systems which don't have json_tokener_errors
Older versions of json-c need to use a different API (which don't exists
on newer versions, unfortunately...)
Thanks to Thomas D. for reporting this problem.
Build error:
[ 77s] msg.c: In function 'MsgSetPropsViaJSON':
[ 77s] msg.c:4077:14: error: 'json_tokener_errors' undeclared (first use in this function)
[ 77s] errMsg = json_tokener_errors[err];
diff --git a/runtime/msg.c b/runtime/msg.c
index 66c3b7b..81b13f9 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -4074,7 +4074,11 @@ MsgSetPropsViaJSON(msg_t *__restrict__ const pMsg, const uchar *__restrict__ con
err = tokener->err;
if(err != json_tokener_continue)
- errMsg = json_tokener_errors[err];
+# if HAVE_JSON_TOKENER_ERROR_DESC
+ errMsg = json_tokener_error_desc(err);
+# else
+ errMsg = json_tokener_errors[err];
+# endif
else
errMsg = "Unterminated input";
} else if(!json_object_is_type(json, json_type_object))