![Alex Suykov](/assets/img/avatar_default.png)
uClibc defines __GLIBC__ but does not provide res_nquery. Fixes: http://autobuild.buildroot.net/results/17248fa7f4deaacdab9bb22a777f51209af11e60/ http://autobuild.buildroot.net/results/bf155246563e2f6c44e18f7ee423305600a68b7e/ http://autobuild.buildroot.net/results/32a8c566604e79bf2de7d7236b49b6ab40b8cefd/ http://autobuild.buildroot.net/results/4093e4679412b50048860299dcfc301927e2cabc/ Signed-off-by: Alex Suykov <alex.suykov@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
34 lines
990 B
Diff
34 lines
990 B
Diff
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
|
|
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
|
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
|
|
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
|
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
|
|
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
|
ret = res_nquery(&res, label, C_IN, rrtype, answer, sizeof(answer));
|
|
#else
|
|
ret = res_query(label, C_IN, rrtype, answer, sizeof(answer));
|