From: Florian Forster Date: Tue, 6 Nov 2018 14:13:01 +0000 (+0100) Subject: log_logstash plugin: Fix non-portable struct initialization with "{}". X-Git-Tag: collectd-5.9.0~52^2^2~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2988%2Fhead;p=thirdparty%2Fcollectd.git log_logstash plugin: Fix non-portable struct initialization with "{}". --- diff --git a/src/log_logstash.c b/src/log_logstash.c index 8df431361..6ebab3bea 100644 --- a/src/log_logstash.c +++ b/src/log_logstash.c @@ -183,22 +183,14 @@ err: static void log_logstash_log(int severity, const char *msg, user_data_t __attribute__((unused)) * user_data) { - yajl_gen g; -#if !defined(HAVE_YAJL_V2) - yajl_gen_config conf = {}; - - conf.beautify = 0; -#endif - if (severity > log_level) return; #if HAVE_YAJL_V2 - g = yajl_gen_alloc(NULL); + yajl_gen g = yajl_gen_alloc(NULL); #else - g = yajl_gen_alloc(&conf, NULL); + yajl_gen g = yajl_gen_alloc(&(yajl_gen_config){0}, NULL); #endif - if (g == NULL) { fprintf(stderr, "Could not allocate JSON generator.\n"); return;