[Date Prev][Date Next] [Chronological] [Thread] [Top]

gai_strerror (ITS#845)



Full_Name: Stig Venaas
Version: head
OS: 
URL: http://domen.uninett.no/~venaas/ldap_pvt_gai_strerror.c
Submission from: (NULL) (129.241.20.74)


Here is a substitute gai_strerror function. In the same place as
getaddrinfo is defined (should be netdb.h), there should also be
defined macros for the error values, for instance EAI_FAIL. Since
the actual values are not standardized we must use the macros. All
implementations should have them, but all should have gai_strerror
that we are replacing too. I would like to try this, but if it fails,
we'll have to ifdef all of them. I've done that for EAI_ADDRFAMILY
and EAI_NODATA since there is at least one draft spec that does not
list them.

I'm not sure how you wish to use it, perhaps

#ifdef HAVE_GAI_STRERROR
this code
#define LDAP_GAI_STRERROR(x) ldap_pvt_gai_strerror(x)
#else
#define LDAP_GAI_STRERROR(x) gai_strerror(x)
#endif

and then replace the gai_strerror calls? When this is in place, I think
I'll also submit a patch for os-ip.c using this to give better error
reports. So it would be good if you put it in some common place and not
inside daemon.c.

Stig