diff options
Diffstat (limited to 'ext/sleepy_penguin/eventfd.c')
-rw-r--r-- | ext/sleepy_penguin/eventfd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/sleepy_penguin/eventfd.c b/ext/sleepy_penguin/eventfd.c index 4da5e45..9d75c91 100644 --- a/ext/sleepy_penguin/eventfd.c +++ b/ext/sleepy_penguin/eventfd.c @@ -87,7 +87,7 @@ static VALUE incr(int argc, VALUE *argv, VALUE self) RTEST(nonblock) ? rb_sp_set_nonblock(x.fd) : blocking_io_prepare(x.fd); x.val = (uint64_t)NUM2ULL(value); retry: - w = (ssize_t)rb_sp_io_region(efd_write, &x); + w = (ssize_t)rb_sp_fd_region(efd_write, &x, x.fd); if (w == -1) { if (errno == EAGAIN && RTEST(nonblock)) return Qfalse; @@ -123,11 +123,11 @@ static VALUE getvalue(int argc, VALUE *argv, VALUE self) x.fd = rb_sp_fileno(self); RTEST(nonblock) ? rb_sp_set_nonblock(x.fd) : blocking_io_prepare(x.fd); retry: - w = (ssize_t)rb_sp_io_region(efd_read, &x); + w = (ssize_t)rb_sp_fd_region(efd_read, &x, x.fd); if (w == -1) { if (errno == EAGAIN && RTEST(nonblock)) return Qnil; - if (rb_io_wait_readable(x.fd)) + if (rb_io_wait_readable(x.fd = rb_sp_fileno(self))) goto retry; rb_sys_fail("read(eventfd)"); } |