diff options
-rw-r--r-- | spec/ruby/optional/capi/ext/io_spec.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -28,13 +28,9 @@ static int set_non_blocking(int fd) { } static int io_spec_get_fd(VALUE io) { -#ifdef RUBY_VERSION_IS_3_1 - return rb_io_descriptor(io); -#else rb_io_t* fp; GetOpenFile(io, fp); return fp->fd; -#endif } VALUE io_spec_GetOpenFile_fd(VALUE self, VALUE io) { @@ -307,7 +303,7 @@ VALUE io_spec_rb_io_set_nonblock(VALUE self, VALUE io) { GetOpenFile(io, fp); rb_io_set_nonblock(fp); #ifdef F_GETFL - flags = fcntl(io_spec_get_fd(io), F_GETFL, 0); return flags & O_NONBLOCK ? Qtrue : Qfalse; #else return Qfalse; @@ -326,13 +322,9 @@ static VALUE io_spec_errno_set(VALUE self, VALUE val) { } VALUE io_spec_mode_sync_flag(VALUE self, VALUE io) { -#ifdef RUBY_VERSION_IS_3_3 - if (rb_io_mode(io) & FMODE_SYNC) { -#else rb_io_t *fp; GetOpenFile(io, fp); if (fp->mode & FMODE_SYNC) { -#endif return Qtrue; } else { return Qfalse; |