Skip to content

Commit d6b4e09

Browse files
ioquatixlarskanis
authored andcommitted
Add support for sockaddr_un on Windows. (#6513)
* Windows: Fix warning about undefined if_indextoname() * Windows: Fix UNIXSocket on MINGW and make .pair more reliable * Windows: Use nonblock=true for read tests with scheduler * Windows: Move socket detection from File.socket? to File.stat Add S_IFSOCK to Windows and interpret reparse points accordingly. Enable tests that work now. * Windows: Use wide-char functions to UNIXSocket This fixes behaviour with non-ASCII characters. It also fixes deletion of temporary UNIXSocket.pair files. * Windows: Add UNIXSocket tests for specifics of Windows impl. * Windows: fix VC build due to missing _snwprintf Avoid usage of _snwprintf, since it fails linking ruby.dll like so: linking shared-library x64-vcruntime140-ruby320.dll x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol snwprintf x64-vcruntime140-ruby320.def : error LNK2001: unresolved external symbol vsnwprintf_l whereas linking miniruby.exe succeeds. This patch uses snprintf on the UTF-8 string instead. Also remove branch GetWindowsDirectoryW, since it doesn't work. * Windows: Fix dangling symlink test failures Co-authored-by: Lars Kanis <[email protected]>
1 parent 213e6a3 commit d6b4e09

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/fileutils/test_fileutils.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,14 @@ def test_cp_r_dev
472472
else
473473
def test_cp_r_socket
474474
pend "Skipping socket test on JRuby" if RUBY_ENGINE == 'jruby'
475+
475476
Dir.mkdir('tmp/cpr_src')
476477
UNIXServer.new('tmp/cpr_src/socket').close
477478
cp_r 'tmp/cpr_src', 'tmp/cpr_dest'
478479
assert_equal(true, File.socket?('tmp/cpr_dest/socket'))
480+
rescue Errno::EINVAL => error
481+
# On some platforms (windows) sockets cannot be copied by FileUtils.
482+
omit error.message
479483
end if defined?(UNIXServer)
480484
end
481485

0 commit comments

Comments
 (0)