From e265ef92429e09fe298f5ac628dc77061df130b5 Mon Sep 17 00:00:00 2001 From: Micah Cowan Date: Fri, 12 Jun 2009 01:32:44 -0700 Subject: [PATCH] Declare h_errno if no declaration provided (HP-UX). --- ChangeLog | 5 +++++ configure.ac | 2 ++ src/ChangeLog | 5 +++++ src/host.c | 5 +++++ 4 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3c976238..e7b0060b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-12 Micah Cowan + + * configure.ac: Check for h_errno declaration. Idea thanks to + Maciej W. Rozycki. + 2009-03-03 Steven Schubiger * src/ftp.c, src/http.c, src/main.c, src/recur.h, diff --git a/configure.ac b/configure.ac index 2ccc703d..78fd5e14 100644 --- a/configure.ac +++ b/configure.ac @@ -163,6 +163,8 @@ AC_CHECK_HEADERS(unistd.h sys/time.h) AC_CHECK_HEADERS(termios.h sys/ioctl.h sys/select.h utime.h sys/utime.h) AC_CHECK_HEADERS(stdint.h inttypes.h pwd.h wchar.h) +AC_CHECK_DECLS(h_errno,,,[#include ]) + dnl dnl Check sizes of integer types. These are used to find n-bit dnl integral types on older systems that fail to provide intN_t and diff --git a/src/ChangeLog b/src/ChangeLog index 464e8a91..33362331 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-06-12 Micah Cowan + + * host.c: Declare h_errno if no declaration is provided. Idea + thanks to Maciej W. Rozycki. + 2009-06-11 Xin Zou * http.c (gethttp): Fix some memory leaks. diff --git a/src/host.c b/src/host.c index fdb35b1c..e65a23aa 100644 --- a/src/host.c +++ b/src/host.c @@ -58,6 +58,11 @@ as that of the covered work. */ # define NO_ADDRESS NO_DATA #endif +#if !HAVE_DECL_H_ERRNO +extern int h_errno; +#endif + + /* Lists of IP addresses that result from running DNS queries. See lookup_host for details. */