ruby-changes:70682
From: Samuel <ko1@a...>
Date: Sat, 1 Jan 2022 16:23:57 +0900 (JST)
Subject: [ruby-changes:70682] 243320d22f (master): Fix incorrect minimum read length. (#5353)
https://git.ruby-lang.org/ruby.git/commit/?id=243320d22f From 243320d22fcd0b9b7ee4cc5b1b420dcd63d87f5f Mon Sep 17 00:00:00 2001 From: Samuel Williams <samuel.williams@o...> Date: Sat, 1 Jan 2022 20:23:47 +1300 Subject: Fix incorrect minimum read length. (#5353) --- io.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/io.c b/io.c index deb5a7950e3..3fab54e4067 100644 --- a/io.c +++ b/io.c @@ -1133,14 +1133,10 @@ rb_read_internal(rb_io_t *fptr, void *buf, size_t count) https://github.com/ruby/ruby/blob/trunk/io.c#L1133 { VALUE scheduler = rb_fiber_scheduler_current(); if (scheduler != Qnil) { - VALUE result = rb_fiber_scheduler_io_read_memory(scheduler, fptr->self, buf, count, count); + VALUE result = rb_fiber_scheduler_io_read_memory(scheduler, fptr->self, buf, count, 0); if (result != Qundef) { - ssize_t length = rb_fiber_scheduler_io_result_apply(result); - - if (length < 0) rb_sys_fail_path(fptr->pathv); - - return length; + return rb_fiber_scheduler_io_result_apply(result); } } -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/