packages/admin/zabbix/patches/002-fix-res_send-on-uclibc.patch
mirko 81938508b5 [packages/zabbix] level up zabbix to version 2.0.0
git-svn-id: svn://svn.openwrt.org/openwrt/packages@32497 3c298f89-4303-0410-b956-a3cf2f4a3e73
2012-06-24 19:03:42 +00:00

36 lines
1.6 KiB
Diff

--- a/configure.in 2012-05-21 14:07:37.000000000 +0000
+++ b/configure.in 2012-06-21 19:46:34.843662509 +0000
@@ -149,6 +149,10 @@
AC_MSG_ERROR([Unable to DNS lookup functions "${found_resolv}"])
fi
LIBS="${LIBS} ${RESOLV_LIBS}"
+AC_SEARCH_LIBS([res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])])
+AC_SEARCH_LIBS([__res_mkquery], [], [AC_DEFINE([HAVE_RES_MKQUERY], 1, [Define if res_mkquery exists])])
+AC_SEARCH_LIBS([res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])])
+AC_SEARCH_LIBS([__res_send], [], [AC_DEFINE([HAVE_RES_SEND], 1, [Define if res_send exists])])
dnl *****************************************************************
dnl * *
--- a/src/libs/zbxsysinfo/common/net.c 2012-06-21 19:49:46.610567432 +0000
+++ b/src/libs/zbxsysinfo/common/net.c 2012-06-21 19:50:35.816628541 +0000
@@ -418,6 +418,7 @@
#else /* not _WINDOWS */
res_init(); /* initialize always, settings might have changed */
+#if defined(HAVE_RES_MKQUERY) && defined(HAVE_RES_SEND)
if (-1 == (res = res_mkquery(QUERY, zone, C_IN, type, NULL, 0, NULL, buf, sizeof(buf))))
return SYSINFO_RET_FAIL;
@@ -436,6 +437,11 @@
_res.retry = retry;
res = res_send(buf, res, answer.buffer, sizeof(answer.buffer));
+#else /* defined(HAVE_RES_QUERY) && defined(HAVE_RES_SEND) */
+ /* retrand and retry are ignored */
+ if (-1 == (res = res_query(zone, C_IN, type, answer.buffer, sizeof(answer.buffer))))
+ return SYSINFO_RET_FAIL;
+#endif
hp = (HEADER *)answer.buffer;