about summary refs log tree commit diff
path: root/sysdeps/posix
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix')
-rw-r--r--sysdeps/posix/getaddrinfo.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 45d1da22f9..17d27e786e 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -266,10 +266,18 @@ gaih_inet_serv (const char *servicename, struct gaih_typeproto *tp,
     rc = __gethostbyname2_r (name, _family, &th, tmpbuf,	\
          tmpbuflen, &h, &herrno);				\
   } while (rc == ERANGE && herrno == NETDB_INTERNAL);		\
-  if (rc != 0 && herrno == NETDB_INTERNAL)			\
+  if (rc != 0)							\
     {								\
-      __set_h_errno (herrno);					\
-      return -EAI_SYSTEM;					\
+      if (herrno == NETDB_INTERNAL)				\
+	{							\
+	  __set_h_errno (herrno);				\
+	  return -EAI_SYSTEM;					\
+	}							\
+      if (herrno == TRY_AGAIN)					\
+	{							\
+	  __set_h_errno (herrno);				\
+	  return -EAI_AGAIN;					\
+	}							\
     }								\
   if (h != NULL)						\
     {								\