|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 Patch 71641-proper-errors-for-getaddrinfo-php55.patch for Streams related Bug #71641Patch version 2016-02-22 10:16 UTCReturn to Bug #71641 | Download this patch This patch renders other patches obsolete Obsolete patches: 
 Developer: torotil@gmail.com
diff --git a/main/network.c b/main/network.c
index 138f86b..235a78d 100644
--- a/main/network.c
+++ b/main/network.c
@@ -107,9 +107,9 @@ const struct in6_addr in6addr_any = {0}; /* IN6ADDR_ANY_INIT; */
 
 #if HAVE_GETADDRINFO
 #ifdef HAVE_GAI_STRERROR
-#  define PHP_GAI_STRERROR(x) (gai_strerror(x))
+#  define PHP_GAI_STRERROR(x) (x == EAI_SYSTEM ? strerror(errno) : gai_strerror(x))
 #else
-#  define PHP_GAI_STRERROR(x) (php_gai_strerror(x))
+#  define PHP_GAI_STRERROR(x) (x == EAI_SYSTEM ? strerror(errno) : php_gai_strerror(x))
 /* {{{ php_gai_strerror
  */
 static const char *php_gai_strerror(int code)
 | 
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 08:00:01 2025 UTC |