Skip to content

Commit 7d7ed0e

Browse files
committed
Pass the new "IO#dup always sets the autoclose flag for the new IO object" spec
1 parent 42ee1e9 commit 7d7ed0e

File tree

1 file changed

+2
-0
lines changed
  • src/main/ruby/truffleruby/core

1 file changed

+2
-0
lines changed

src/main/ruby/truffleruby/core/io.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,8 @@ def initialize_copy(original) # :nodoc:
10191019
# We want to ensure newly allocated FDs never take the standard IO ones, even
10201020
# if a STDIO stream is closed.
10211021
Primitive.io_set_fd(self, Truffle::POSIX.fcntl(fd, F_DUPFD_CLOEXEC, 3))
1022+
1023+
self.autoclose = true
10221024
end
10231025

10241026
def advise(advice, offset = 0, len = 0)

0 commit comments

Comments
 (0)