Jim Meyering wrote:
> On Freebsd8-rc2 I saw this:
> 
>   test-getaddrinfo.c: In function 'simple':
>   test-getaddrinfo.c:95: error: 'EAI_NODATA' undeclared (first use in this 
> function)
> 
> lib/netdb.h was not generated.
> 
> Here's one way to fix it, but
> I haven't dug enough yet to know if that's appropriate:
> 
> diff --git a/tests/test-getaddrinfo.c b/tests/test-getaddrinfo.c
> index 384b98b..57c1a4d 100644
> --- a/tests/test-getaddrinfo.c
> +++ b/tests/test-getaddrinfo.c
> @@ -91,10 +91,12 @@ simple (char const *host, char const *service)
>        fail the test merely because of this.  */
>        if (res == EAI_SERVICE)
>       return 0;
> +#ifdef EAI_NODATA
>        /* AIX reports EAI_NODATA for "https".  Don't fail the test
>        merely because of this.  */
>        if (res == EAI_NODATA)
>       return 0;
> +#endif
>        /* Provide details if errno was set.  */
>        if (res == EAI_SYSTEM)
>       dbgprintf ("system error: %s\n", strerror (err));

Yes, it's the best way to fix this. EAI_NODATA is not mandated by POSIX,
therefore it is OK if gnulib does not override <netdb.h> on this platform.
Hence it's the test which has to be corrected.

Bruno


Reply via email to