File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,15 @@ void rb_deprecate_constant(VALUE mod, const char *name);
6666
6767#include "constdefs.h"
6868
69+ #ifndef HAVE_RB_IO_DESCRIPTOR
70+ static int
71+ rb_io_descriptor (VALUE io ) {
72+ rb_io_t * fptr ;
73+ GetOpenFile (io , fptr );
74+ return fptr -> fd ;
75+ }
76+ #endif
77+
6978#ifdef HAVE_RUBY_ATOMIC_H
7079# include "ruby/atomic.h"
7180#else
@@ -941,14 +950,11 @@ io_pathconf(VALUE io, VALUE arg)
941950{
942951 int name ;
943952 long ret ;
944- rb_io_t * fptr ;
945953
946954 name = NUM2INT (arg );
947955
948- GetOpenFile (io , fptr );
949-
950956 errno = 0 ;
951- ret = fpathconf (fptr -> fd , name );
957+ ret = fpathconf (rb_io_descriptor ( io ) , name );
952958 if (ret == -1 ) {
953959 if (errno == 0 ) /* no limit */
954960 return Qnil ;
Original file line number Diff line number Diff line change 5050# TODO: remove when dropping 2.7 support, as exported since 3.0
5151have_func ( 'rb_deprecate_constant(Qnil, "None")' )
5252
53+ have_func ( "rb_io_descriptor" )
54+
5355$distcleanfiles << "constdefs.h"
5456
5557create_makefile ( "etc" )
You can’t perform that action at this time.
0 commit comments