pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

collectd: adapt to newer versions of librdkafka



Module Name:	pkgsrc-wip
Committed By:	Edgar Fuß <ef%math.uni-bonn.de@localhost>
Pushed By:	ef
Date:		Fri Jul 17 18:31:52 2020 +0200
Changeset:	9b2898df9e1720124ed1323c6c8523b8a74cc417

Added Files:
	collectd/patches/patch-src_read_kafka.c

Log Message:
collectd: adapt to newer versions of librdkafka

Add patch patch-src_read_kafka.c to adapt to newer versions of librdkafka (from upstream commit 7536b41b8dee524307d3f9d4bf8773b7ec8314f0).

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=9b2898df9e1720124ed1323c6c8523b8a74cc417

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 collectd/patches/patch-src_read_kafka.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diffs:
diff --git a/collectd/patches/patch-src_read_kafka.c b/collectd/patches/patch-src_read_kafka.c
new file mode 100644
index 0000000000..2b6b1ceb33
--- /dev/null
+++ b/collectd/patches/patch-src_read_kafka.c
@@ -0,0 +1,31 @@
+$NetBSD: patch-src_read_kafka.c $
+
+Adapt to newer librdkafka.
+From collect commit 7536b41b8dee524307d3f9d4bf8773b7ec8314f0.
+
+--- src/write_kafka.c.orig
++++ src/write_kafka.c
+@@ -77,6 +77,14 @@ static void kafka_log(const rd_kafka_t *rkt, int level, const char *fac,
+ }
+ #endif
+ 
++static rd_kafka_resp_err_t kafka_error() {
++#if RD_KAFKA_VERSION >= 0x000b00ff
++  return rd_kafka_last_error();
++#else
++  return rd_kafka_errno2err(errno);
++#endif
++}
++
+ static uint32_t kafka_hash(const char *keydata, size_t keylen) {
+   uint32_t hash = 5381;
+   for (; keylen > 0; keylen--)
+@@ -147,7 +155,7 @@ static int kafka_handle(struct kafka_topic_context *ctx) /* {{{ */
+     if ((ctx->topic = rd_kafka_topic_new(ctx->kafka, ctx->topic_name,
+                                          topic_conf)) == NULL) {
+       ERROR("write_kafka plugin: cannot create topic : %s\n",
+-            rd_kafka_err2str(rd_kafka_errno2err(errno)));
++            rd_kafka_err2str(kafka_error()));
+       return errno;
+     }
+ 


Home | Main Index | Thread Index | Old Index