php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #71641
Patch 71641-proper-errors-for-getaddrinfo-php55.patch revision 2016-02-22 10:16 UTC by torotil at gmail dot com
revision 2016-02-22 09:57 UTC by torotil at gmail dot com
Patch 7 revision 2016-02-22 10:15 UTC by torotil at gmail dot com

Patch 7 for Streams related Bug #71641

Patch version 2016-02-22 10:15 UTC

Return to Bug #71641 | Download this patch
This patch is obsolete

Obsoleted by patches:

This patch renders other patches obsolete

Obsolete patches:

Patch Revisions:

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)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 13 02:01:27 2024 UTC