diff options
-rw-r--r-- | spec/ruby/optional/capi/ext/io_spec.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -143,7 +143,11 @@ VALUE io_spec_rb_io_wait_readable(VALUE self, VALUE io, VALUE read_p) { errno = saved_errno; } ret = rb_io_wait_readable(fd); if (RTEST(read_p)) { ssize_t r = read(fd, buf, RB_IO_WAIT_READABLE_BUF); @@ -162,7 +166,11 @@ VALUE io_spec_rb_io_wait_readable(VALUE self, VALUE io, VALUE read_p) { } VALUE io_spec_rb_io_wait_writable(VALUE self, VALUE io) { int ret = rb_io_wait_writable(io_spec_get_fd(io)); return ret ? Qtrue : Qfalse; } @@ -230,13 +238,23 @@ VALUE io_spec_rb_thread_wait_fd(VALUE self, VALUE io) { } VALUE io_spec_rb_wait_for_single_fd(VALUE self, VALUE io, VALUE events, VALUE secs, VALUE usecs) { - int fd = io_spec_get_fd(io); struct timeval tv; if (!NIL_P(secs)) { tv.tv_sec = FIX2INT(secs); tv.tv_usec = FIX2INT(usecs); } return INT2FIX(rb_wait_for_single_fd(fd, FIX2INT(events), NIL_P(secs) ? NULL : &tv)); } VALUE io_spec_rb_thread_fd_writable(VALUE self, VALUE io) { |