Just passing FDs does not need to create IO objects

This commit is contained in:
Nobuyoshi Nakada 2025-12-19 09:47:22 +09:00
parent bfba65d8c1
commit 6f6ea70dce
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
Notes: git 2025-12-19 05:19:38 +00:00

View File

@ -122,13 +122,9 @@ def setup_make
opts = {}
if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ make_flags
begin
r = IO.for_fd($1.to_i(10), "rb", autoclose: false)
w = IO.for_fd($2.to_i(10), "wb", autoclose: false)
rescue Errno::EBADF
else
opts[r] = r
opts[w] = w
[$1, $2].each do |fd|
fd = fd.to_i(10)
opts[fd] = fd
end
end