Skip to content

Commit 6f6ea70

Browse files
committed
Just passing FDs does not need to create IO objects
1 parent bfba65d commit 6f6ea70

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

spec/ruby/optional/capi/spec_helper.rb

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,9 @@ def setup_make
122122

123123
opts = {}
124124
if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ make_flags
125-
begin
126-
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
127-
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
128-
rescue Errno::EBADF
129-
else
130-
opts[r] = r
131-
opts[w] = w
125+
[$1, $2].each do |fd|
126+
fd = fd.to_i(10)
127+
opts[fd] = fd
132128
end
133129
end
134130

0 commit comments

Comments
 (0)