summaryrefslogtreecommitdiff
path: root/ext/socket/getaddrinfo.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-13 13:57:53 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-13 13:57:53 +0000
commitbadd44845e77d6813de6b18b39ab3bcd646cbf01 (patch)
tree9a2c20b37a4f2b4ffcb5a0684f8e5979c5ed8fb8 /ext/socket/getaddrinfo.c
parented15422759aef6f0fa17fb9595b799b6aa487a73 (diff)
* ext/socket/addrinfo.h (AI_NUMERICSERV): defined.
(AI_MASK): add AI_NUMERICSERV. * ext/socket/getaddrinfo.c (getaddrinfo): support AI_NUMERICSERV. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/getaddrinfo.c')
-rw-r--r--ext/socket/getaddrinfo.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/socket/getaddrinfo.c b/ext/socket/getaddrinfo.c
index de16b9f..ef01a60 100644
--- a/ext/socket/getaddrinfo.c
+++ b/ext/socket/getaddrinfo.c
@@ -375,6 +375,8 @@ getaddrinfo(const char *hostname, const char *servname, const struct addrinfo *h
pai->ai_protocol = IPPROTO_UDP;
}
port = htons((unsigned short)atoi(servname));
+ } else if (pai->ai_flags & AI_NUMERICSERV) {
+ ERR(EAI_NONAME);
} else {
struct servent *sp;
const char *proto;