From 30f5a2bbcd0151ce25b1e55dcff31626d4ab253a Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Sun, 26 Jun 2022 01:13:33 +1200 Subject: [ruby/io-nonblock] Don't define nonblock methods if they are defined by core. https://github.com/ruby/io-nonblock/commit/5d3991859c --- ext/io/nonblock/nonblock.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ext/io/nonblock/nonblock.c') diff --git a/ext/io/nonblock/nonblock.c b/ext/io/nonblock/nonblock.c index 4c729a760c..d90538f735 100644 --- a/ext/io/nonblock/nonblock.c +++ b/ext/io/nonblock/nonblock.c @@ -66,6 +66,8 @@ set_fcntl_flags(int fd, int f) rb_sys_fail(0); } +#ifndef RUBY_IO_NONBLOCK_METHODS + static int io_nonblock_set(int fd, int f, int nb) { @@ -146,6 +148,8 @@ rb_io_nonblock_set(VALUE self, VALUE value) return self; } +#endif /* RUBY_IO_NONBLOCK_METHODS */ + static VALUE io_nonblock_restore(VALUE arg) { @@ -193,7 +197,10 @@ rb_io_nonblock_block(int argc, VALUE *argv, VALUE self) void Init_nonblock(void) { +#ifndef RUBY_IO_NONBLOCK_METHODS rb_define_method(rb_cIO, "nonblock?", rb_io_nonblock_p, 0); rb_define_method(rb_cIO, "nonblock=", rb_io_nonblock_set, 1); +#endif + rb_define_method(rb_cIO, "nonblock", rb_io_nonblock_block, -1); } -- cgit v1.2.3