c6b1f4642d
* Miscellaneous bug fixes. - ruby core dumps by segmentation violation because of wrong checking whether block was given. - PTY module function dose not reset SIGALRM handler when child process executing command on pty. - There is a error for calling raise method in lib/delegate.rb. * Try to honor PKG_SILENT and PKG_VERBOSE. * Experimental fix for getaddrinfo(3) problem on Darwin (not tested).
28 lines
693 B
Text
28 lines
693 B
Text
$NetBSD: patch-ao,v 1.1 2004/03/12 04:59:20 taca Exp $
|
|
|
|
--- ext/socket/socket.c.orig 2002-11-01 03:40:11.000000000 +0900
|
|
+++ ext/socket/socket.c
|
|
@@ -585,6 +585,23 @@ ip_addrsetup(host, port)
|
|
rb_raise(rb_eSocket, "getaddrinfo: %s", gai_strerror(error));
|
|
}
|
|
|
|
+#if defined(__APPLE__) && defined(__MACH__)
|
|
+ {
|
|
+ struct addrinfo *r;
|
|
+ r = res;
|
|
+ while (r) {
|
|
+ if (! r->ai_socktype) r->ai_socktype = hints.ai_socktype;
|
|
+ if (! r->ai_protocol) {
|
|
+ if (r->ai_socktype == SOCK_DGRAM) {
|
|
+ r->ai_protocol = IPPROTO_UDP;
|
|
+ } else if (r->ai_socktype == SOCK_STREAM) {
|
|
+ r->ai_protocol = IPPROTO_TCP;
|
|
+ }
|
|
+ }
|
|
+ r = r->ai_next;
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
return res;
|
|
}
|
|
|