[前][次][番号順一覧][スレッド一覧]

ruby-changes:34223

From: akr <ko1@a...>
Date: Mon, 2 Jun 2014 09:46:40 +0900 (JST)
Subject: [ruby-changes:34223] akr:r46291 (trunk): Close FDs.

akr	2014-06-01 10:21:18 +0900 (Sun, 01 Jun 2014)

  New Revision: 46291

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?revision=46291&view=revision

  Log:
    Close FDs.

  Modified files:
    trunk/test/rinda/test_rinda.rb
Index: test/rinda/test_rinda.rb
===================================================================
--- test/rinda/test_rinda.rb	(revision 46290)
+++ test/rinda/test_rinda.rb	(revision 46291)
@@ -754,6 +754,8 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L754
     v4 = @rf.make_socket('127.0.0.1')
 
     assert(v4.getsockopt(:SOL_SOCKET, :SO_BROADCAST).bool)
+  ensure
+    v4.close if v4
   end
 
   def test_make_socket_ipv4_multicast
@@ -761,6 +763,8 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L763
 
     assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_LOOP).ipv4_multicast_loop)
     assert_equal(1, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).ipv4_multicast_ttl)
+  ensure
+    v4mc.close if v4mc
   end
 
   def test_make_socket_ipv6_multicast
@@ -774,12 +778,16 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L778
 
     assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_LOOP).int)
     assert_equal(1, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int)
+  ensure
+    v6mc.close if v6mc
   end
 
   def test_make_socket_ipv4_multicast_hops
     @rf.multicast_hops = 2
     v4mc = @rf.make_socket('239.0.0.1')
     assert_equal(2, v4mc.getsockopt(:IPPROTO_IP, :IP_MULTICAST_TTL).ipv4_multicast_ttl)
+  ensure
+    v4mc.close if v4mc
   end
 
   def test_make_socket_ipv6_multicast_hops
@@ -792,6 +800,8 @@ class TestRingFinger < Test::Unit::TestC https://github.com/ruby/ruby/blob/trunk/test/rinda/test_rinda.rb#L800
       v6mc = @rf.make_socket("ff02::1%#{ifaddr.name}")
     end
     assert_equal(2, v6mc.getsockopt(:IPPROTO_IPV6, :IPV6_MULTICAST_HOPS).int)
+  ensure
+    v6mc.close if v6mc
   end
 
 end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]