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

ruby-changes:38801

From: eregon <ko1@a...>
Date: Sun, 14 Jun 2015 06:27:43 +0900 (JST)
Subject: [ruby-changes:38801] eregon:r50882 (trunk): * test/ruby/test_io.rb: add test for IO.binread fd leak.

eregon	2015-06-14 06:26:32 +0900 (Sun, 14 Jun 2015)

  New Revision: 50882

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

  Log:
    * test/ruby/test_io.rb: add test for IO.binread fd leak.
      See r50881.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_io.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50881)
+++ ChangeLog	(revision 50882)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jun 14 06:24:57 2015  Benoit Daloze  <eregontp@g...>
+
+	* test/ruby/test_io.rb: add test for IO.binread fd leak.
+	  See r50881.
+
 Sun Jun 14 05:23:51 2015  Benoit Daloze  <eregontp@g...>
 
 	* io.c (rb_io_s_binread): close fd if seek offset is invalid.
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 50881)
+++ test/ruby/test_io.rb	(revision 50882)
@@ -2740,6 +2740,10 @@ End https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L2740
     end
   end
 
+  def test_s_binread_does_not_leak_with_invalid_offset
+    assert_raise(Errno::EINVAL) { IO.binread(__FILE__, 0, -1) }
+  end
+
   def test_s_binwrite
     mkcdtmpdir do
       path = "test_s_binwrite"

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

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