diff options
author | Eric Wong <e@80x24.org> | 2017-03-16 20:07:13 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-03-16 20:10:32 +0000 |
commit | 3b64b24b38482ddc5a65eae3408a9eafec4b7aae (patch) | |
tree | fa1e120c1a1c6750cac3bebdc6e4b9d010aea78e /ext/sleepy_penguin/eventfd.c | |
parent | e7703d878199f24432f707c359668a721b681a77 (diff) | |
download | sleepy_penguin-3b64b24b38482ddc5a65eae3408a9eafec4b7aae.tar.gz |
Ruby 1.8 is long dead and we already broke 1.9 support by using keyword args for splice, sendfile, and copy_file_range support.
Diffstat (limited to 'ext/sleepy_penguin/eventfd.c')
-rw-r--r-- | ext/sleepy_penguin/eventfd.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/sleepy_penguin/eventfd.c b/ext/sleepy_penguin/eventfd.c index 4804150..1cb2c4e 100644 --- a/ext/sleepy_penguin/eventfd.c +++ b/ext/sleepy_penguin/eventfd.c @@ -82,7 +82,9 @@ static VALUE incr(int argc, VALUE *argv, VALUE self) rb_scan_args(argc, argv, "11", &value, &nonblock); x.fd = rb_sp_fileno(self); - RTEST(nonblock) ? rb_sp_set_nonblock(x.fd) : blocking_io_prepare(x.fd); + if (RTEST(nonblock)) + rb_sp_set_nonblock(x.fd); + x.val = (uint64_t)NUM2ULL(value); retry: w = (ssize_t)rb_sp_fd_region(efd_write, &x, x.fd); @@ -119,7 +121,8 @@ static VALUE getvalue(int argc, VALUE *argv, VALUE self) rb_scan_args(argc, argv, "01", &nonblock); x.fd = rb_sp_fileno(self); - RTEST(nonblock) ? rb_sp_set_nonblock(x.fd) : blocking_io_prepare(x.fd); + if (RTEST(nonblock)) + rb_sp_set_nonblock(x.fd); retry: w = (ssize_t)rb_sp_fd_region(efd_read, &x, x.fd); if (w < 0) { |