[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS shishi/gl
From: |
shishi-commit |
Subject: |
CVS shishi/gl |
Date: |
Wed, 10 Nov 2004 19:10:30 +0100 |
Update of /home/cvs/shishi/gl
In directory dopio:/tmp/cvs-serv3297/gl
Modified Files:
getaddrinfo.c
Log Message:
Update.
--- /home/cvs/shishi/gl/getaddrinfo.c 2004/11/09 18:18:50 1.1
+++ /home/cvs/shishi/gl/getaddrinfo.c 2004/11/10 18:10:30 1.2
@@ -26,15 +26,34 @@
/* Get memcpy. */
#include <string.h>
+/* Get struct hostent. */
+#include <netdb.h>
+
+#include <stdbool.h>
+
#include "gettext.h"
#define _(String) gettext (String)
#define N_(String) String
-/* Get struct hostent. */
-#include <netdb.h>
-
#include "getaddrinfo.h"
+static inline bool
+validate_family (int family)
+{
+ /* FIXME: Support more families. */
+#if HAVE_IPV4
+ if (family == PF_INET)
+ return true;
+#endif
+#if HAVE_IPV6
+ if (family == PF_INET6)
+ return true;
+#endif
+ if (family == PF_UNSPEC)
+ return true;
+ return false;
+}
+
/* Translate name of a service location and/or a service name to set of
socket addresses. */
int
@@ -52,15 +71,7 @@
/* FIXME: Support more flags. */
return EAI_BADFLAGS;
- if (hints
-#if HAVE_IPV4
- && hints->ai_family != PF_INET
-#endif
-#if HAVE_IPV6
- && hints->ai_family != PF_INET6
-#endif
- && hints->ai_family != PF_UNSPEC)
- /* FIXME: Support more families. */
+ if (hints && !validate_family (hints->ai_family))
return EAI_FAMILY;
if (hints && hints->ai_socktype)
- CVS shishi/gl, shishi-commit, 2004/11/08
- CVS shishi/gl, shishi-commit, 2004/11/09
- CVS shishi/gl,
shishi-commit <=
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/11
- CVS shishi/gl, shishi-commit, 2004/11/12
- CVS shishi/gl, shishi-commit, 2004/11/19
- CVS shishi/gl, shishi-commit, 2004/11/19
- CVS shishi/gl, shishi-commit, 2004/11/21
- CVS shishi/gl, shishi-commit, 2004/11/28