From 9603e288446876c5a9f94f08ad8c123a3344c38f Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 10 Mar 2004 08:21:07 +0000 Subject: * eval.c (return_jump): set return value to the return destination. separated from localjump_destination(). * eval.c (break_jump): break innermost loop (or thread or proc). * eval.c (rb_yield_0): set exit_value for block break. * eval.c (eval): Only print backtrace if generating the backtrace doesn't generate an exception. [ruby-core:02621] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/socket.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'ext/socket') diff --git a/ext/socket/socket.c b/ext/socket/socket.c index eb75168cb2..7c1b43b538 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -651,6 +651,23 @@ sock_addrinfo(host, port, socktype, flags) 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; } -- cgit v1.2.3