Skip to content

Commit 1b425ee

Browse files
committed
Add self member for rb_io_t struct to fix issue with OpenSSL
OpenSSL uses `rb_io_maybe_wait_readable` if it presents and relies on rb_io_t. self
1 parent 258cb5a commit 1b425ee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/truffle/truffle/cext_structs.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,13 @@ def polyglot_has_members?
365365
end
366366

367367
def polyglot_members(internal)
368-
['stdio_file', 'fd', 'mode', 'pathv', 'pid', 'lineno', 'tied_io_for_writing']
368+
['self', 'stdio_file', 'fd', 'mode', 'pathv', 'pid', 'lineno', 'tied_io_for_writing']
369369
end
370370

371371
def polyglot_read_member(name)
372372
case name
373+
when 'self'
374+
Primitive.cext_wrap(@io)
373375
when 'fd'
374376
Primitive.io_fd(@io)
375377
when 'mode'
@@ -405,7 +407,7 @@ def polyglot_invoke_member(name, *args)
405407
end
406408

407409
def polyglot_member_readable?(name)
408-
name == 'fd' || name == 'mode' || name == 'pathv' || 'tied_io_for_writing'
410+
name == 'self' || name == 'fd' || name == 'mode' || name == 'pathv' || 'tied_io_for_writing'
409411
end
410412

411413
def polyglot_member_modifiable?(name)

0 commit comments

Comments
 (0)