From 3b64b24b38482ddc5a65eae3408a9eafec4b7aae Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 16 Mar 2017 20:07:13 +0000 Subject: drop unused Ruby 1.8 support code 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. --- ext/sleepy_penguin/eventfd.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ext/sleepy_penguin/eventfd.c') 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) { -- cgit v1.2.3-24-ge0c7