File rsyslog-8.4.0-json-c-0.12.patch of Package rsyslog.6132

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 c994f25..014282d 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -4085,7 +4085,11 @@ MsgSetPropsViaJSON(msg_t *__restrict__ const pMsg, const uchar *__restrict__ con
 
 			err = tokener->err;
 			if(err != json_tokener_continue)
+#			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))

openSUSE Build Service is sponsored by