[krbdev.mit.edu #2379] sane_hostname.c fails to compile on HP UX 10.20

DEEngert@anl.gov via RT rt-comment at krbdev.mit.edu
Wed Mar 10 17:33:42 EST 2004



util/pty/sane_hostname.c failes to compile on a HP UX 10.20
as h_errno is not defined. 

sane_hostname.c includes pty-int.h that includes netdb.h

Later sane_hostname.c includes fake_addrinfo.h
that defines _XOPEN_SOURCE_EXTENDED then includes netdb.h
so as to get h_errno defined. But since netdb.h was already
included the hack has no effect. 

So here is hack to the hack: 

*** ,fake-addrinfo.h    Mon Dec 15 20:19:09 2003
--- fake-addrinfo.h     Wed Mar 10 16:10:03 2004
***************
*** 552,557 ****
--- 552,560 ----
  /* Hack for HPUX, to get h_errno.  */
  # define _XOPEN_SOURCE_EXTENDED 1
  # include <netdb.h>
+ # ifndef h_ERRNO_KT_DEFINED
+ extern int h_errno;
+ # endif
  # undef _XOPEN_SOURCE_EXTENDED
  #endif

On HP UX 11.0, 11.11 and 11.23 the original hack is not needed
as h_errno is defined by the first include of netdb.h. They also
define h_ERRNO_KT_DEFINED at that time, so it can be used
to test in h_errno needs to be defined in an earlier HP system. 
  
The patch might even be reworked to not have to define 
the _XOPEN_SOURCE_EXTENDED as in HP 10.20 the define is always a int. 

-- 

 Douglas E. Engert  <DEEngert at anl.gov>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439 
 (630) 252-5444


More information about the krb5-bugs mailing list