summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2009-05-05 15:50:24 +0200
committerDavid 'Digit' Turner <digit@google.com>2009-05-05 15:50:24 +0200
commit5e563700380eade647f347669ea61dbb0ede9814 (patch)
tree739599d59b328c4f0880196f0d57f0d7c7f3a0f0
parent85a01ffba337b123436f57eba4daae38c7c90d1e (diff)
downloadbionic-5e563700380eade647f347669ea61dbb0ede9814.zip
bionic-5e563700380eade647f347669ea61dbb0ede9814.tar.gz
bionic-5e563700380eade647f347669ea61dbb0ede9814.tar.bz2
change getaddrinfo() implementation to match GLibc.
the issue is that the BSD implementation doesn't accept a call like: getaddrinfo(SERVER_NAME, "9999", NULL, &res); because if will reject a numerical string in the second parameter if no hints are explicitely provided. This technically doesn't violate POSIX but might make porting Linux software a bit difficult. For more details see: http://groups.google.com/group/android-ndk/browse_thread/thread/818ab9c53f24c87 also comment debugging printf() calls which shouldn't be there.
-rw-r--r--libc/netbsd/net/getaddrinfo.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libc/netbsd/net/getaddrinfo.c b/libc/netbsd/net/getaddrinfo.c
index 2dd3d97..f2189fb 100644
--- a/libc/netbsd/net/getaddrinfo.c
+++ b/libc/netbsd/net/getaddrinfo.c
@@ -912,7 +912,11 @@ get_port(const struct addrinfo *ai, const char *servname, int matchonly)
allownumeric = 1;
break;
case ANY:
+#if 1 /* ANDROID-SPECIFIC CHANGE TO MATCH GLIBC */
+ allownumeric = 1;
+#else
allownumeric = 0;
+#endif
break;
default:
return EAI_SOCKTYPE;
@@ -1271,7 +1275,7 @@ _dns_getaddrinfo(void *rv, void *cb_data, va_list ap)
name = va_arg(ap, char *);
pai = va_arg(ap, const struct addrinfo *);
- fprintf(stderr, "_dns_getaddrinfo() name = '%s'\n", name);
+ //fprintf(stderr, "_dns_getaddrinfo() name = '%s'\n", name);
memset(&q, 0, sizeof(q));
memset(&q2, 0, sizeof(q2));
@@ -1630,7 +1634,7 @@ res_searchN(const char *name, struct res_target *target, res_state res)
trailing_dot++;
-fprintf(stderr, "res_searchN() name = '%s'\n", name);
+ //fprintf(stderr, "res_searchN() name = '%s'\n", name);
/*
* if there aren't any dots, it could be a user-level alias