about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--sysdeps/posix/getaddrinfo.c31
2 files changed, 20 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 1515942136..8e6b5274f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2013-12-02  Pavel Simerda  <psimerda@redhat.com>
 
+	* sysdeps/posix/getaddrinfo.c (GAIH_OKIFUNSPEC): Remove macro.
+	(GAIH_EAI): Likewise.
+	(gaih_inet_serv): Don't use GAIH_OKIFUNSPEC.
+	(gaih_inet): Likewise.
+	(getaddrinfo): Don't use GAIH_EAI.
+
 	* sysdeps/posix/getaddrinfo.c (UNIX_PATH_MAX): Remove macro.
 	(struct gaih): Remove definition.
 
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index 387c22f65b..8218237af2 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -71,9 +71,6 @@ extern int __idna_to_unicode_lzlz (const char *input, char **output,
 # include <libidn/idna.h>
 #endif
 
-#define GAIH_OKIFUNSPEC 0x0100
-#define GAIH_EAI        ~(GAIH_OKIFUNSPEC)
-
 struct gaih_service
   {
     const char *name;
@@ -157,7 +154,7 @@ gaih_inet_serv (const char *servicename, const struct gaih_typeproto *tp,
 	  if (r == ERANGE)
 	    tmpbuflen *= 2;
 	  else
-	    return GAIH_OKIFUNSPEC | -EAI_SERVICE;
+	    return -EAI_SERVICE;
 	}
     }
   while (r);
@@ -299,9 +296,9 @@ gaih_inet (const char *name, const struct gaih_service *service,
       if (! tp->name[0])
 	{
 	  if (req->ai_socktype)
-	    return GAIH_OKIFUNSPEC | -EAI_SOCKTYPE;
+	    return -EAI_SOCKTYPE;
 	  else
-	    return GAIH_OKIFUNSPEC | -EAI_SERVICE;
+	    return -EAI_SERVICE;
 	}
     }
 
@@ -309,7 +306,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
   if (service != NULL)
     {
       if ((tp->protoflag & GAI_PROTO_NOSERVICE) != 0)
-	return GAIH_OKIFUNSPEC | -EAI_SERVICE;
+	return -EAI_SERVICE;
 
       if (service->num < 0)
 	{
@@ -345,7 +342,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
 		  if ((rc = gaih_inet_serv (service->name, tp, req, newp)))
 		    {
-		      if (rc & GAIH_OKIFUNSPEC)
+		      if (rc)
 			continue;
 		      return rc;
 		    }
@@ -354,7 +351,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		  pst = &(newp->next);
 		}
 	      if (st == (struct gaih_servtuple *) &nullserv)
-		return GAIH_OKIFUNSPEC | -EAI_SERVICE;
+		return -EAI_SERVICE;
 	    }
 	}
       else
@@ -546,7 +543,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 							10);
 		      if (*end != '\0')
 			{
-			  result = GAIH_OKIFUNSPEC | -EAI_NONAME;
+			  result = -EAI_NONAME;
 			  goto free_and_return;
 			}
 		    }
@@ -667,7 +664,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 		  else
 		    /* We made requests but they turned out no data.
 		       The name is known, though.  */
-		    result = GAIH_OKIFUNSPEC | -EAI_NODATA;
+		    result = -EAI_NODATA;
 
 		  goto free_and_return;
 		}
@@ -773,7 +770,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
 		  if (at->family == AF_UNSPEC)
 		    {
-		      result = GAIH_OKIFUNSPEC | -EAI_NONAME;
+		      result = -EAI_NONAME;
 		      goto free_and_return;
 		    }
 
@@ -1064,7 +1061,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 
 	  if (h_errno == NETDB_INTERNAL)
 	    {
-	      result = GAIH_OKIFUNSPEC | -EAI_SYSTEM;
+	      result = -EAI_SYSTEM;
 	      goto free_and_return;
 	    }
 
@@ -1076,7 +1073,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
 	      else
 		/* We made requests but they turned out no data.  The name
 		   is known, though.  */
-		result = GAIH_OKIFUNSPEC | -EAI_NODATA;
+		result = -EAI_NODATA;
 
 	      goto free_and_return;
 	    }
@@ -1085,7 +1082,7 @@ gaih_inet (const char *name, const struct gaih_service *service,
     process_list:
       if (at->family == AF_UNSPEC)
 	{
-	  result = GAIH_OKIFUNSPEC | -EAI_NONAME;
+	  result = -EAI_NONAME;
 	  goto free_and_return;
 	}
     }
@@ -2412,7 +2409,7 @@ getaddrinfo (const char *name, const char *service,
 	  freeaddrinfo (p);
 	  __free_in6ai (in6ai);
 
-	  return -(last_i & GAIH_EAI);
+	  return -last_i;
 	}
       while (*end)
 	{
@@ -2645,7 +2642,7 @@ getaddrinfo (const char *name, const char *service,
       return 0;
     }
 
-  return last_i ? -(last_i & GAIH_EAI) : EAI_NONAME;
+  return last_i ? -last_i : EAI_NONAME;
 }
 libc_hidden_def (getaddrinfo)