From: Richard Levitte Date: Fri, 16 Dec 2016 02:50:40 +0000 (+0100) Subject: HP-UX doesn't have hstrerror(), so make our own for that platform X-Git-Tag: OpenSSL_1_1_1-pre1~2838 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7d9533bfa2fe5a5bf2bb19ff6c70558f6caeb92d;p=oweals%2Fopenssl.git HP-UX doesn't have hstrerror(), so make our own for that platform Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2092) (cherry picked from commit 46766d003666da5f90346da7e6d09e109355f5c6) --- diff --git a/crypto/bio/b_addr.c b/crypto/bio/b_addr.c index 29f92cf7c7..0f1900db9e 100644 --- a/crypto/bio/b_addr.c +++ b/crypto/bio/b_addr.c @@ -18,6 +18,30 @@ #include #include +#ifdef _HPUX_SOURCE +static const char *ossl_hstrerror(int herr) +{ + switch (herr) { + case -1: + return strerror(errno); + case 0: + return "No error"; + case HOST_NOT_FOUND: + return "Host not found"; + case NO_DATA: /* NO_ADDRESS is a synonym */ + return "No data"; + case NO_RECOVERY: + return "Non recoverable error"; + case TRY_AGAIN: + return "Try again"; + default: + break; + } + return "unknown error"; +} +# define hstrerror(e) ossl_hstrerror(e) +#endif + CRYPTO_RWLOCK *bio_lookup_lock; static CRYPTO_ONCE bio_lookup_init = CRYPTO_ONCE_STATIC_INIT;