diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2021-12-27 17:06:00 +1300 |
---|---|---|
committer | NARUSE, Yui <nurse@users.noreply.github.com> | 2022-01-31 15:35:55 +0900 |
commit | bdd3cf00370c0e56187f81159565f555c5eb9b6a (patch) | |
tree | b2243a67d3696d938aa913fd85d1294dfdb1d915 /io.c | |
parent | aa3b2c81c8de2e70bd100e92436f15c03523eaf7 (diff) |
Fix incorrect minimum read length.
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -1133,14 +1133,10 @@ rb_read_internal(rb_io_t *fptr, void *buf, size_t count) { 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); } } |