Project

General

Profile

Bug #17527 ยป rb_io_wait_methods_with_scheduler_skip_errno_checks.patch

ysbaddaden (Julien Portalier), 01/11/2021 05:30 PM

View differences:

io.c
int
rb_io_wait_readable(int f)
{
VALUE scheduler = rb_scheduler_current();
if (scheduler != Qnil) {
return RTEST(
rb_scheduler_io_wait_readable(scheduler, rb_io_from_fd(f))
);
}
VALUE scheduler;
io_fd_check_closed(f);
switch (errno) {
......
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
rb_thread_wait_fd(f);
scheduler = rb_scheduler_current();
if (scheduler != Qnil) {
return RTEST(
rb_scheduler_io_wait_readable(scheduler, rb_io_from_fd(f))
);
} else {
rb_thread_wait_fd(f);
}
return TRUE;
default:
......
int
rb_io_wait_writable(int f)
{
VALUE scheduler = rb_scheduler_current();
if (scheduler != Qnil) {
return RTEST(
rb_scheduler_io_wait_writable(scheduler, rb_io_from_fd(f))
);
}
VALUE scheduler;
io_fd_check_closed(f);
switch (errno) {
......
#if defined(EWOULDBLOCK) && EWOULDBLOCK != EAGAIN
case EWOULDBLOCK:
#endif
rb_thread_fd_writable(f);
scheduler = rb_scheduler_current();
if (scheduler != Qnil) {
return RTEST(
rb_scheduler_io_wait_writable(scheduler, rb_io_from_fd(f))
);
} else {
rb_thread_fd_writable(f);
}
return TRUE;
default:
    (1-1/1)