From 432a992aafc6756a02963629f49ff26b1489ddc8 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 2 Jan 2012 11:54:52 +0000 Subject: * lib/securerandom.rb (random_bytes): use IO#read instead of IO#readpartial to make the intent more clear. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ lib/securerandom.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cbecfc2365..23c978f1a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Jan 2 20:53:36 2012 Tanaka Akira + + * 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 * test/ruby/test_object.rb (test_send_with_block): add a normal case. diff --git a/lib/securerandom.rb b/lib/securerandom.rb index 04e8bc205e..eede2fef04 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -78,7 +78,7 @@ module SecureRandom 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 -- cgit v1.2.3