From b7bc0cae539617af4dfac5b44b0ebd700efe2084 Mon Sep 17 00:00:00 2001 From: matz Date: Tue, 4 Jun 2002 07:34:19 +0000 Subject: * string.c (rb_str_aset): should raise error if an indexing string is not found in the receiver. * sprintf.c (rb_f_sprintf): "%d" should convert objects into integers using Integer(). * lib/tempfile.rb (Tempfile::size): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/socket/extconf.rb | 5 +++-- ext/socket/socket.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'ext/socket') diff --git a/ext/socket/extconf.rb b/ext/socket/extconf.rb index c288408946..11639c0b0d 100644 --- a/ext/socket/extconf.rb +++ b/ext/socket/extconf.rb @@ -62,7 +62,7 @@ else end $ipv6 = false -if enable_config("ipv6", false) +if enable_config("ipv6", true) if try_link(< #include @@ -226,7 +226,7 @@ have_struct_member('struct msghdr', 'msg_control', header=['sys/types.h', 'sys/s have_struct_member('struct msghdr', 'msg_accrights', header=['sys/types.h', 'sys/socket.h']) $getaddr_info_ok = false -if not enable_config("wide-getaddrinfo", false) and try_run(< #include #include @@ -322,6 +322,7 @@ if $ipv6 and not $getaddr_info_ok Fatal: --enable-ipv6 is specified, and your OS seems to support IPv6 feature. But your getaddrinfo() and getnameinfo() are appeared to be broken. Sorry, you cannot compile IPv6 socket classes with broken these functions. +You can try --enable-wide-getaddrinfo. EOS exit end diff --git a/ext/socket/socket.c b/ext/socket/socket.c index 2fcb4a5a76..1a27e481a2 100644 --- a/ext/socket/socket.c +++ b/ext/socket/socket.c @@ -590,7 +590,7 @@ sock_addrinfo(host, port, socktype, flags) portp = 0; } else if (FIXNUM_P(port)) { - snprintf(pbuf, sizeof(pbuf), "%ld", FIX2INT(port)); + snprintf(pbuf, sizeof(pbuf), "%d", FIX2INT(port)); portp = pbuf; } else { @@ -678,7 +678,7 @@ ipaddr(sockaddr) error = getnameinfo(sockaddr, SA_LEN(sockaddr), hbuf, sizeof(hbuf), pbuf, sizeof(pbuf), NI_NUMERICHOST | NI_NUMERICSERV); if (error) { - rb_raise(rb_eSocket, "getnameinfo %s", gai_strerror(error)); + rb_raise(rb_eSocket, "getnameinfo: %s", gai_strerror(error)); } addr2 = rb_tainted_str_new2(hbuf); if (do_not_reverse_lookup) { -- cgit v1.2.3