From 7f5828f0fba0172baacebf9f75594ab222db0159 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Tue, 4 Jul 2000 08:44:03 +0000 Subject: 12149: guard against undefined h_errno in zftp --- ChangeLog | 5 +++++ Src/Modules/zftp.c | 4 ++++ acconfig.h | 3 +++ configure.in | 11 +++++++++++ 4 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 41c782ce8..1f8fe0c3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-07-03 Peter Stephenson + + * 12149: acconfig.h, configure.in, Src/Modules/zftp.c: + h_errno wasn't found on HPUX 10.20. Maybe in some library. + 2000-07-04 Sven Wischnowsky * 12156: Completion/Core/_expand, Completion/Core/_path_files: add diff --git a/Src/Modules/zftp.c b/Src/Modules/zftp.c index b1aac07b8..e39994733 100644 --- a/Src/Modules/zftp.c +++ b/Src/Modules/zftp.c @@ -111,6 +111,10 @@ union zftp_sockaddr { #endif }; +#ifdef USE_LOCAL_H_ERRNO +int h_errno; +#endif + /* We use the RFC 2553 interfaces. If the functions don't exist in the library, simulate them. */ diff --git a/acconfig.h b/acconfig.h index 2f553d1b3..5b4dd4041 100644 --- a/acconfig.h +++ b/acconfig.h @@ -296,3 +296,6 @@ /* Define to 1 if ino_t is 64 bit (for large file support) */ #undef INO_T_IS_64_BIT + +/* Define to 1 if h_errno is not defined by the system */ +#undef USE_LOCAL_H_ERRNO diff --git a/configure.in b/configure.in index f4de01060..31903ea4d 100644 --- a/configure.in +++ b/configure.in @@ -816,6 +816,17 @@ zsh_STRUCT_MEMBER([ #include ], struct sockaddr_in6, sin6_scope_id) +dnl Check for h_errno external variable +AC_CACHE_CHECK(if we need our own h_errno, + zsh_cv_decl_h_errno_use_local, + [AC_TRY_LINK( ,[extern int h_errno; h_errno = 0;], + zsh_cv_decl_h_errno_use_local=no, + zsh_cv_decl_h_errno_use_local=yes)]) + +if test $zsh_cv_decl_h_errno_use_local = yes; then + AC_DEFINE(USE_LOCAL_H_ERRNO) +fi + dnl --------------- dnl CHECK FUNCTIONS dnl --------------- -- cgit 1.4.1