Merge pull request #10878 from neheb/zab
authorEtienne Champetier <champetier.etienne@gmail.com>
Tue, 31 Dec 2019 04:50:34 +0000 (20:50 -0800)
committerGitHub <noreply@github.com>
Tue, 31 Dec 2019 04:50:34 +0000 (20:50 -0800)
zabbix: Fix compilation with uClibc-ng

admin/zabbix/Makefile
admin/zabbix/patches/120-uclibc-res.patch [new file with mode: 0644]

index 75760955b5da2e551e03201a908bef3467e84cc5..7630a8770b9e3c9e9221267b304e83e954db0b6b 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zabbix
 PKG_VERSION:=4.0.16
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/zabbix
diff --git a/admin/zabbix/patches/120-uclibc-res.patch b/admin/zabbix/patches/120-uclibc-res.patch
new file mode 100644 (file)
index 0000000..d88e008
--- /dev/null
@@ -0,0 +1,23 @@
+--- a/src/libs/zbxsysinfo/common/net.c
++++ b/src/libs/zbxsysinfo/common/net.c
+@@ -547,7 +547,7 @@ static int dns_query(AGENT_REQUEST *request, AGENT_RESULT *result, int short_ans
+               return SYSINFO_RET_FAIL;
+       }
+-#if defined(HAVE_RES_NINIT) && !defined(_AIX)
++#if defined(HAVE_RES_NINIT) && !defined(_AIX) && !defined(__UCLIBC__)
+       if (-1 == (res = res_nmkquery(&res_state_local, QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf))))
+ #else
+       if (-1 == (res = res_mkquery(QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf))))
+@@ -643,7 +643,11 @@ static int        dns_query(AGENT_REQUEST *request, AGENT_RESULT *result, int short_ans
+       res_state_local.retrans = retrans;
+       res_state_local.retry = retry;
++#ifndef __UCLIBC__
+       res = res_nsend(&res_state_local, buf, res, answer.buffer, sizeof(answer.buffer));
++#else
++      res = res_search(*res_state_local.dnsrch, res, 0, answer.buffer, sizeof(answer.buffer));
++#endif
+ #     ifdef HAVE_RES_U_EXT    /* Linux */
+       if (NULL != ip && '\0' != *ip && AF_INET6 == ip_type)