summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ext/io/wait/wait.c2
-rw-r--r--test/io/wait/test_io_wait.rb2
-rw-r--r--version.h6
4 files changed, 13 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c60c9cfec..f06e6aab0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Tue Mar 3 02:42:27 2015 Eric Wong <e@80x24.org>
+
+ * ext/io/wait/wait.c (io_nread): wrap return value with INT2FIX
+ Thanks to Yura Sokolov <funny.falcon@gmail.com>
+ [ruby-core:68369] [Bug#10923]
+ * test/io/wait/test_io_wait.rb (test_nread_buffered):
+ fix broken test
+
Sun Mar 1 02:30:23 2015 Seiei Higa <hanachin@gmail.com>
* vm_method.c (rb_alias): raise a NameError when creating alias to
diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c
index d8bb55fc47..ce8cfbbeb4 100644
--- a/ext/io/wait/wait.c
+++ b/ext/io/wait/wait.c
@@ -62,7 +62,7 @@ io_nread(VALUE io)
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
len = rb_io_read_pending(fptr);
- if (len > 0) return len;
+ if (len > 0) return INT2FIX(len);
if (!FIONREAD_POSSIBLE_P(fptr->fd)) return INT2FIX(0);
if (ioctl(fptr->fd, FIONREAD, &n)) return INT2FIX(0);
if (n > 0) return ioctl_arg2num(n);
diff --git a/test/io/wait/test_io_wait.rb b/test/io/wait/test_io_wait.rb
index 46097e00c6..6d8b0442ae 100644
--- a/test/io/wait/test_io_wait.rb
+++ b/test/io/wait/test_io_wait.rb
@@ -31,7 +31,7 @@ class TestIOWait < Test::Unit::TestCase
def test_nread_buffered
@w.syswrite ".\n!"
- assert_equal ".\n", @r.read(2)
+ assert_equal ".\n", @r.gets
assert_equal 1, @r.nread
end
diff --git a/version.h b/version.h
index d70d742f46..83954470ca 100644
--- a/version.h
+++ b/version.h
@@ -1,10 +1,10 @@
#define RUBY_VERSION "2.1.5"
-#define RUBY_RELEASE_DATE "2015-03-01"
-#define RUBY_PATCHLEVEL 305
+#define RUBY_RELEASE_DATE "2015-03-03"
+#define RUBY_PATCHLEVEL 306
#define RUBY_RELEASE_YEAR 2015
#define RUBY_RELEASE_MONTH 3
-#define RUBY_RELEASE_DAY 1
+#define RUBY_RELEASE_DAY 3
#include "ruby/version.h"