Skip to content

Fix configure.ac not including headers required by resolv.h (issue #257)#316

Open
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:fix/issue-257-resolv-headers
Open

Fix configure.ac not including headers required by resolv.h (issue #257)#316
thegushi wants to merge 1 commit into
trusteddomainproject:developfrom
thegushi:fix/issue-257-resolv-headers

Conversation

@thegushi
Copy link
Copy Markdown
Collaborator

Summary

The res_ninit and res_ndestroy detection blocks in configure.ac included resolv.h directly, without first including the prerequisite headers identified by AC_HEADER_RESOLV. On non-glibc platforms where resolv.h requires sys/types.h, netinet/in.h, arpa/nameser.h, or netdb.h, the checks would silently fail to detect the functions even when present.

This fix adds the standard conditional include block before resolv.h in both detection blocks, consistent with what AC_HEADER_RESOLV is designed to ensure.

Credit to @futatuki for the diagnosis and original fix (f946ec9), and to @Adadov for an independently verified implementation (c52b7d7).

Fixes #257.

Test plan

  • Confirm ./configure correctly detects res_ninit/res_ndestroy on a non-glibc platform (e.g. musl or older FreeBSD)
  • Confirm no regression on glibc (Linux) — detection should still work as before

…usteddomainproject#257)

Include sys/types.h, netinet/in.h, arpa/nameser.h, and netdb.h before
resolv.h in the res_ninit and res_ndestroy detection blocks, consistent
with what AC_HEADER_RESOLV requires.  On non-glibc platforms that need
these prerequisites, the checks were silently failing to detect the
functions even when present.
@thegushi thegushi added the needs-testing Item in a testing branch, feedback required to merge label May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-testing Item in a testing branch, feedback required to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant