Skip Menu |
 

Date: Wed, 10 Mar 2004 16:33:51 -0600
From: "Douglas E. Engert" <deengert@anl.gov>
To: krb5-bugs@mit.edu
Subject: sane_hostname.c fails to compile on HP UX 10.20
Download (untitled) / with headers
text/plain 1.2KiB

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@anl.gov>
Argonne National Laboratory
9700 South Cass Avenue
Argonne, Illinois 60439
(630) 252-5444
From: raeburn@mit.edu
Subject: CVS Commit
* fake-addrinfo.h: Don't include netdb.h, since port-sockets.h already does.
* port-sockets.h: Define _XOPEN_SOURCE_EXTENDED around inclusion of netdb.h if
it's not defined and not Windows, as fake-addrinfo.h used to do; otherwise just
include it normally.


To generate a diff of this commit:



cvs diff -r1.448 -r1.449 krb5/src/include/ChangeLog
cvs diff -r1.46 -r1.47 krb5/src/include/fake-addrinfo.h
cvs diff -r1.20 -r1.21 krb5/src/include/port-sockets.h
From: raeburn@mit.edu
Subject: CVS Commit
* pty-int.h: Include port-sockets.h instead of netdb.h and netinet/in.h.


To generate a diff of this commit:



cvs diff -r1.127 -r1.128 krb5/src/util/pty/ChangeLog
cvs diff -r1.20 -r1.21 krb5/src/util/pty/pty-int.h
[DEEngert@anl.gov - Wed Mar 10 17:33:40 2004]:

Show quoted text
> 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.

Doug, could you please see if the changes I just checked in on the trunk
fix this problem for you? I know port-sockets.h is including netdb.h,
but now it should define _XOPEN_SOURCE_EXTENDED like fake-addrinfo.h
used to, and pty-int.h includes port-sockets.h. If in fact that's the
first inclusion of netdb.h, I think it'll get the h_errno declaration.
From: tlyu@mit.edu
Subject: CVS Commit
* port-sockets.h: Remove _XOPEN_SOURCE_EXTENDED hack for netdb.h,
as it can cause inconsistencies between headers. It significantly
broke HP-UX 10.20 anyway.


To generate a diff of this commit:



cvs diff -r1.464 -r1.465 krb5/src/include/ChangeLog
cvs diff -r1.22 -r1.23 krb5/src/include/port-sockets.h