ruby-changes:22126
From: akr <ko1@a...>
Date: Mon, 2 Jan 2012 20:55:43 +0900 (JST)
Subject: [ruby-changes:22126] akr:r34175 (trunk): * lib/securerandom.rb (random_bytes): use IO#read instead of
akr 2012-01-02 20:54:52 +0900 (Mon, 02 Jan 2012) New Revision: 34175 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=34175 Log: * lib/securerandom.rb (random_bytes): use IO#read instead of IO#readpartial to make the intent more clear. Modified files: trunk/ChangeLog trunk/lib/securerandom.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 34174) +++ ChangeLog (revision 34175) @@ -1,3 +1,8 @@ +Mon Jan 2 20:53:36 2012 Tanaka Akira <akr@f...> + + * lib/securerandom.rb (random_bytes): use IO#read instead of + IO#readpartial to make the intent more clear. + Mon Jan 2 15:26:39 2012 Kazuki Tsujimoto <kazuki@c...> * test/ruby/test_object.rb (test_send_with_block): add a normal case. Index: lib/securerandom.rb =================================================================== --- lib/securerandom.rb (revision 34174) +++ lib/securerandom.rb (revision 34175) @@ -78,7 +78,7 @@ raise Errno::ENOENT end @has_urandom = true - ret = f.readpartial(n) + ret = f.read(n) if ret.length != n raise NotImplementedError, "Unexpected partial read from random device" end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/