summaryrefslogtreecommitdiffstats
path: root/ext/socket
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-18 09:03:16 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-10-18 09:03:16 +0000
commit6eded0bb87a431f53f66aab0b306427b051f83c7 (patch)
tree2b9ac558373e9742e475be19fed72bfb7924a0f9 /ext/socket
parenta7da40cf41a584e8cf09100bacfd3c37d46178a6 (diff)
downloadruby-6eded0bb87a431f53f66aab0b306427b051f83c7.tar.gz
ruby-6eded0bb87a431f53f66aab0b306427b051f83c7.tar.xz
ruby-6eded0bb87a431f53f66aab0b306427b051f83c7.zip
19991018
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket')
-rw-r--r--ext/socket/extconf.rb5
-rw-r--r--ext/socket/socket.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb
index 47addfeff..467c052a8 100644
--- a/ext/socket/extconf.rb
+++ b/ext/socket/extconf.rb
@@ -160,6 +160,10 @@ if try_run(<<EOF)
#include <sys/socket.h>
#include <netinet/in.h>
+#ifndef AF_LOCAL
+#define AF_LOCAL AF_UNIX
+#endif
+
main()
{
int passive, gaierr, inet4 = 0, inet6 = 0;
@@ -176,6 +180,7 @@ main()
goto bad;
}
for (ai = aitop; ai; ai = ai->ai_next) {
+ if (ai->ai_family == AF_LOCAL) continue;
if (ai->ai_addr == NULL ||
ai->ai_addrlen == 0 ||
getnameinfo(ai->ai_addr, ai->ai_addrlen,
diff --git a/ext/socket/socket.c b/ext/socket/socket.c
index a1d707122..408257eeb 100644
--- a/ext/socket/socket.c
+++ b/ext/socket/socket.c
@@ -890,7 +890,9 @@ tcp_s_gethostbyname(obj, host)
struct sockaddr_in6 sin6;
MEMZERO(&sin6, struct sockaddr_in6, 1);
sin6.sin6_family = AF_INET;
+#ifdef SIN6_LEN
sin6.sin6_len = sizeof(sin6);
+#endif
memcpy((char *) &sin6.sin6_addr, *pch, h->h_length);
h = gethostbyaddr((char *)&sin6.sin6_addr,
sizeof(sin6.sin6_addr),