From: Ken Raeburn Date: Tue, 19 Feb 2002 21:34:13 +0000 (+0000) Subject: * fake-addrinfo.c (_XOPEN_SOURCE_EXTENDED): Define if not defined, and if not X-Git-Tag: krb5-1.3-alpha1~878 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=20b1b2a6c0f53d2faa32e784c495463bbc3d58c0;p=krb5.git * 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 *. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14147 dc483132-0cff-0310-8789-dd5450dbe970 --- 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 + + * 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 * 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 +# 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)) /* ??? */