summaryrefslogtreecommitdiff
path: root/ext/socket
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-10 11:59:36 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-06-10 11:59:36 +0000
commit52a802a4285647a8dfce77c0dd5ded1c4532fd73 (patch)
tree33bb4ed185bde7fc1a05ef2e4c1a0705058038b8 /ext/socket
parent6735633663cdb39c95075f0f92f34c6d8f5c4ec6 (diff)
* ext/socket/raddrinfo.c (nogvl_getaddrinfo): work around for Ubuntu
13.04's getaddrinfo issue with mdns4. [ruby-list:49420] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/raddrinfo.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index 6215021..aef0c64 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -157,9 +157,18 @@ struct getaddrinfo_arg
static void *
nogvl_getaddrinfo(void *arg)
{
+ int ret;
struct getaddrinfo_arg *ptr = arg;
- return (void *)(VALUE)getaddrinfo(ptr->node, ptr->service,
+ getaddrinfo(ptr->node, ptr->service,
ptr->hints, ptr->res);
+#ifdef __linux__
+ /* On Linux (mainly Ubuntu 13.04) /etc/nsswitch.conf has mdns4 and
+ * it cause getaddrinfo to return EAI_SYSTEM/ENOENT. [ruby-list:49420]
+ */
+ if (ret == EAI_SYSTEM && errno == ENOENT)
+ ret = EAI_NONAME;
+#endif
+ return (void *)(VALUE)ret;
}
#endif