diff options
Diffstat (limited to 'ext/socket/raddrinfo.c')
-rw-r--r-- | ext/socket/raddrinfo.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c index 80e59a073f..fc2f63a9b3 100644 --- a/ext/socket/raddrinfo.c +++ b/ext/socket/raddrinfo.c @@ -157,9 +157,17 @@ struct getaddrinfo_arg static VALUE nogvl_getaddrinfo(void *arg) { + int ret; struct getaddrinfo_arg *ptr = arg; - return getaddrinfo(ptr->node, ptr->service, - ptr->hints, ptr->res); + ret = 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 (VALUE)ret; } #endif |