From: Koji Arai Date: 2001-08-26T00:11:26+09:00 Subject: [ruby-dev:14572] noisy warnings of resolv.rb 新井です。 resolv.rb が -v つきでやたら warning 出すのでパッチです。 (1.6, 1.7 両方) require 'resolv' p Resolv.new.getaddress("www.ruby-lang.org").to_s => /usr/local/lib/ruby/1.7/resolv.rb:160: warning: timeout (...) interpreted as grouped expression /usr/local/lib/ruby/1.7/resolv.rb:55: warning: instance variable @initialized not initialized /usr/local/lib/ruby/1.7/resolv.rb:113: warning: instance variable @initialized not initialized /usr/local/lib/ruby/1.7/resolv.rb:392: warning: instance variable @initialized not initialized ruby 1.7.1 (2001-08-24) [i586-linux] "210.251.121.214" Index: lib/resolv.rb =================================================================== RCS file: /usr/local/cvsup/ruby/ruby/lib/resolv.rb,v retrieving revision 1.2 diff -u -r1.2 resolv.rb --- lib/resolv.rb 2001/06/19 04:35:15 1.2 +++ lib/resolv.rb 2001/08/25 14:51:39 @@ -48,6 +48,7 @@ def initialize(filename = DefaultFileName) @filename = filename @mutex = Mutex.new + @initialized = nil end def lazy_initialize @@ -106,6 +107,7 @@ def initialize(config="/etc/resolv.conf") @mutex = Mutex.new @config = Config.new(config) + @initialized = nil end def lazy_initialize @@ -157,7 +159,7 @@ end sender.send reply = reply_name = nil - timeout (tout) { reply, reply_name = q.pop } + timeout(tout) { reply, reply_name = q.pop } case reply.rcode when RCode::NoError return extract_resource(reply, reply_name, typeclass) @@ -385,6 +387,7 @@ def initialize(filename="/etc/resolv.conf") @mutex = Mutex.new @filename = filename + @initialized = nil end def lazy_initialize