Skip to content

Commit 4105f64

Browse files
committed
Fix Linux build: use Int32(SOCK_STREAM.rawValue) on non-macOS
1 parent 36cbbf5 commit 4105f64

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Tests/ContainerizationOSTests/BidirectionalRelayTests.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ final class BidirectionalRelayTests {
3333
/// Creates a Unix domain socket pair and returns (fd0, fd1).
3434
private func makeSocketPair() throws -> (Int32, Int32) {
3535
var fds: [Int32] = [0, 0]
36+
#if os(macOS)
3637
let result = socketpair(AF_UNIX, SOCK_STREAM, 0, &fds)
38+
#else
39+
let result = socketpair(AF_UNIX, Int32(SOCK_STREAM.rawValue), 0, &fds)
40+
#endif
3741
try #require(result == 0, "socketpair should succeed, errno: \(errno)")
3842
return (fds[0], fds[1])
3943
}

0 commit comments

Comments
 (0)