diff options
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/ChangeLog | 8 | ||||
| -rw-r--r-- | src/include/fake-addrinfo.c | 12 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 3b405fa08..622df4e28 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,11 @@ +2002-02-19 Ken Raeburn <raeburn@mit.edu> + + * fake-addrinfo.c (_XOPEN_SOURCE_EXTENDED): Define if not defined, + and if not Mac or Windows, for duration of inclusion of netdb.h. + This gets us the h_errno declaration on HP-UX. + (getnameinfo): Cast gethostbyaddr pointer arg to char *, not + sockaddr *. + 2002-02-10 Ken Raeburn <raeburn@mit.edu> * fake-addrinfo.h: Always check for FAI_PREFIX, not just when fake diff --git a/src/include/fake-addrinfo.c b/src/include/fake-addrinfo.c index 1f0047213..a78e9daf4 100644 --- a/src/include/fake-addrinfo.c +++ b/src/include/fake-addrinfo.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2001 by the Massachusetts Institute of Technology, + * Copyright (C) 2001,2002 by the Massachusetts Institute of Technology, * Cambridge, MA, USA. All Rights Reserved. * * This software is being provided to you, the LICENSEE, by the @@ -48,6 +48,13 @@ #include "fake-addrinfo.h" +#if !defined(_XOPEN_SOURCE_EXTENDED) && !defined(HAVE_MACSOCK_H) && !defined(_WIN32) +/* Hack for HPUX, to get h_errno. */ +# define _XOPEN_SOURCE_EXTENDED 1 +# include <netdb.h> +# undef _XOPEN_SOURCE_EXTENDED +#endif + void fixup_addrinfo (struct addrinfo *ai) { struct addrinfo *ai2; @@ -263,7 +270,8 @@ int getnameinfo (const struct sockaddr *sa, socklen_t len, else return EAI_FAIL; /* ?? */ } else { - hp = gethostbyaddr ((struct sockaddr *) &sinp->sin_addr, sizeof (struct in_addr), + hp = gethostbyaddr ((const char *) &sinp->sin_addr, + sizeof (struct in_addr), sa->sa_family); if (hp == 0) { if (h_errno == NO_ADDRESS && !(flags & NI_NAMEREQD)) /* ??? */ |
