[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: EAI_NODATA used in test-getaddrinfo.c
From: |
Bruno Haible |
Subject: |
Re: EAI_NODATA used in test-getaddrinfo.c |
Date: |
Tue, 3 Nov 2009 00:06:43 +0100 |
User-agent: |
KMail/1.9.9 |
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