From 529bbe4fad12bc0cd98155e52355fc7f1d692caa Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Tue, 21 Nov 2017 15:25:46 -0800 Subject: [PATCH] Platform tweaks for h_errno --- ext/lwip/src/api/netdb.c | 2 +- ext/lwip/src/include/lwip/netdb.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/lwip/src/api/netdb.c b/ext/lwip/src/api/netdb.c index deff495..388a7a5 100755 --- a/ext/lwip/src/api/netdb.c +++ b/ext/lwip/src/api/netdb.c @@ -58,7 +58,7 @@ struct gethostbyname_r_helper { /** h_errno is exported in netdb.h for access by applications. */ #if LWIP_DNS_API_DECLARE_H_ERRNO -int h_errno; +//int h_errno; #endif /* LWIP_DNS_API_DECLARE_H_ERRNO */ /** define "hostent" variables storage: 0 if we use a static (but unprotected) diff --git a/ext/lwip/src/include/lwip/netdb.h b/ext/lwip/src/include/lwip/netdb.h index 6aae914..7e6b3b9 100755 --- a/ext/lwip/src/include/lwip/netdb.h +++ b/ext/lwip/src/include/lwip/netdb.h @@ -116,7 +116,13 @@ struct addrinfo { #if LWIP_DNS_API_DECLARE_H_ERRNO /* application accessible error code set by the DNS API functions */ +#if defined(__APPLE__) extern int h_errno; +#endif +#if defined(__linux__) +extern __thread int h_errno; +#endif + #endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/ struct hostent *lwip_gethostbyname(const char *name);