Fix configure.ac not including headers required by resolv.h (issue #257)#316
Open
thegushi wants to merge 1 commit into
Open
Fix configure.ac not including headers required by resolv.h (issue #257)#316thegushi wants to merge 1 commit into
thegushi wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
res_ninitandres_ndestroydetection blocks inconfigure.acincludedresolv.hdirectly, without first including the prerequisite headers identified byAC_HEADER_RESOLV. On non-glibc platforms whereresolv.hrequiressys/types.h,netinet/in.h,arpa/nameser.h, ornetdb.h, the checks would silently fail to detect the functions even when present.This fix adds the standard conditional include block before
resolv.hin both detection blocks, consistent with whatAC_HEADER_RESOLVis 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
./configurecorrectly detectsres_ninit/res_ndestroyon a non-glibc platform (e.g. musl or older FreeBSD)