Fix incorrect minimum read length. (#5353)
This commit is contained in:
parent
5414de4b6e
commit
243320d22f
Notes:
git
2022-01-01 16:24:07 +09:00
Merged-By: ioquatix <samuel@codeotaku.com>
8
io.c
8
io.c
@ -1133,14 +1133,10 @@ rb_read_internal(rb_io_t *fptr, void *buf, size_t count)
|
|||||||
{
|
{
|
||||||
VALUE scheduler = rb_fiber_scheduler_current();
|
VALUE scheduler = rb_fiber_scheduler_current();
|
||||||
if (scheduler != Qnil) {
|
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) {
|
if (result != Qundef) {
|
||||||
ssize_t length = rb_fiber_scheduler_io_result_apply(result);
|
return rb_fiber_scheduler_io_result_apply(result);
|
||||||
|
|
||||||
if (length < 0) rb_sys_fail_path(fptr->pathv);
|
|
||||||
|
|
||||||
return length;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user