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);
66
66
67
67
#include "constdefs.h"
68
68
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
+
69
78
#ifdef HAVE_RUBY_ATOMIC_H
70
79
# include "ruby/atomic.h"
71
80
#else
@@ -941,14 +950,11 @@ io_pathconf(VALUE io, VALUE arg)
941
950
{
942
951
int name ;
943
952
long ret ;
944
- rb_io_t * fptr ;
945
953
946
954
name = NUM2INT (arg );
947
955
948
- GetOpenFile (io , fptr );
949
-
950
956
errno = 0 ;
951
- ret = fpathconf (fptr -> fd , name );
957
+ ret = fpathconf (rb_io_descriptor ( io ) , name );
952
958
if (ret == -1 ) {
953
959
if (errno == 0 ) /* no limit */
954
960
return Qnil ;
Original file line number Diff line number Diff line change 50
50
# TODO: remove when dropping 2.7 support, as exported since 3.0
51
51
have_func ( 'rb_deprecate_constant(Qnil, "None")' )
52
52
53
+ have_func ( "rb_io_descriptor" )
54
+
53
55
$distcleanfiles << "constdefs.h"
54
56
55
57
create_makefile ( "etc" )
You can’t perform that action at this time.
0 commit comments