2015-03-25 23:15:06 +01:00
|
|
|
res_ninit is available in glibc but not in uclibc or musl.
|
|
|
|
|
|
|
|
Signed-off-by: Alex Suykov <alex.suykov@gmail.com>
|
|
|
|
|
|
|
|
--- aiccu/common/resolver.c
|
|
|
|
+++ aiccu/common/resolver.c
|
|
|
|
@@ -26,7 +26,7 @@
|
|
|
|
|
|
|
|
int getrrs(const char *label, int rrtype, void gotrec(unsigned int num, int type, const char *record))
|
|
|
|
{
|
|
|
|
-#ifdef _LINUX
|
2015-03-30 13:13:39 +02:00
|
|
|
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
2015-03-25 23:15:06 +01:00
|
|
|
struct __res_state res;
|
|
|
|
#endif
|
|
|
|
unsigned char answer[8192];
|
|
|
|
@@ -38,7 +38,7 @@ int getrrs(const char *label, int rrtype
|
|
|
|
uint16_t type = 0, class = 0;
|
|
|
|
uint32_t ttl = 0;
|
|
|
|
|
|
|
|
-#ifdef _LINUX
|
2015-03-30 13:13:39 +02:00
|
|
|
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
2015-03-25 23:15:06 +01:00
|
|
|
memset(&res, 0, sizeof(res));
|
|
|
|
res.options = RES_DEBUG;
|
|
|
|
res_ninit(&res);
|
|
|
|
@@ -47,7 +47,7 @@ int getrrs(const char *label, int rrtype
|
|
|
|
#endif
|
|
|
|
|
|
|
|
memset(answer, 0, sizeof(answer));
|
|
|
|
-#ifdef _LINUX
|
2015-03-30 13:13:39 +02:00
|
|
|
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
2015-03-25 23:15:06 +01:00
|
|
|
ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
|
|
|
|
#else
|
|
|
|
ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
|