Merge pull request #2126 from lynxis/libmicrohttpd
[feed/packages.git] / admin / zabbix / patches / 002-fix-res_send-on-uclibc.patch
index 3d84929450fb69dd25b19927229bd2373e966867..f4b5d33a12d9317958b85f1a19a092312f711b29 100644 (file)
@@ -1,6 +1,6 @@
 --- a/configure.ac
 +++ b/configure.ac
-@@ -152,6 +152,10 @@ if test "x$found_resolv" != "xyes"; then
+@@ -161,6 +161,10 @@ if test "x$found_resolv" != "xyes"; then
        AC_MSG_ERROR([Unable to do DNS lookups (libresolv check failed)])
  fi
  LIBS="${LIBS} ${RESOLV_LIBS}"
  dnl *                                                               *
 --- a/src/libs/zbxsysinfo/common/net.c
 +++ b/src/libs/zbxsysinfo/common/net.c
-@@ -425,6 +425,7 @@ static int dns_query(AGENT_REQUEST *requ
-       if (-1 == res_init())   /* initialize always, settings might have changed */
+@@ -471,6 +471,7 @@ static int dns_query(AGENT_REQUEST *requ
                return SYSINFO_RET_FAIL;
+       }
  
 +#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;
-@@ -449,6 +450,11 @@ static int        dns_query(AGENT_REQUEST *requ
+       {
+               SET_MSG_RESULT(result, zbx_dsprintf(NULL, "Cannot create DNS query: %s", zbx_strerror(errno)));
+@@ -505,6 +506,11 @@ static int        dns_query(AGENT_REQUEST *requ
        _res.retry = retry;
  
        res = res_send(buf, res, answer.buffer, sizeof(answer.buffer));
@@ -31,5 +31,5 @@
 +      return SYSINFO_RET_FAIL;
 +#endif 
  
+       _res.options = saved_options;
        _res.retrans = saved_retrans;
-       _res.retry = saved_retry;