HP-UX doesn't have hstrerror(), so make our own for that platform
authorRichard Levitte <levitte@openssl.org>
Fri, 16 Dec 2016 02:50:40 +0000 (03:50 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 16 Dec 2016 13:37:56 +0000 (14:37 +0100)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2092)
(cherry picked from commit 46766d003666da5f90346da7e6d09e109355f5c6)

crypto/bio/b_addr.c

index 29f92cf7c72ea592bdd0d6546f4a7b4bfc207395..0f1900db9ed5a9e19347acce7d36727167156fc4 100644 (file)
 #include <internal/thread_once.h>
 #include <ctype.h>
 
 #include <internal/thread_once.h>
 #include <ctype.h>
 
+#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;
 
 CRYPTO_RWLOCK *bio_lookup_lock;
 static CRYPTO_ONCE bio_lookup_init = CRYPTO_ONCE_STATIC_INIT;