Skip to content

Commit 4eed700

Browse files
committed
Update SocketDescriptor
1 parent 3953a37 commit 4eed700

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/Socket/System/SocketOperations.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ extension SocketDescriptor {
179179
) -> Result<(), Errno> {
180180
nothingOrErrno(retryOnInterrupt: retryOnInterrupt) {
181181
option.withUnsafeBytes { bufferPointer in
182-
system_setsockopt(self.rawValue, Option.ID.optionLevel.rawValue, Option.id.rawValue, bufferPointer.baseAddress!, UInt32(bufferPointer.count))
182+
system_setsockopt(self.rawValue, Option.ID.optionLevel.rawValue, Option.id.rawValue, bufferPointer.baseAddress!, CInterop.SocketLength(bufferPointer.count))
183183
}
184184
}
185185
}
@@ -208,7 +208,7 @@ extension SocketDescriptor {
208208
) -> Result<Option, Errno> {
209209
do {
210210
let value = try Option.withUnsafeBytes { bufferPointer throws(Errno) -> () in
211-
var length = UInt32(bufferPointer.count)
211+
var length = CInterop.SocketLength(bufferPointer.count)
212212
guard system_getsockopt(self.rawValue, Option.ID.optionLevel.rawValue, Option.id.rawValue, bufferPointer.baseAddress!, &length) != -1 else {
213213
throw Errno.current
214214
}
@@ -498,7 +498,7 @@ extension SocketDescriptor {
498498
internal func _accept(
499499
retryOnInterrupt: Bool
500500
) -> Result<SocketDescriptor, Errno> {
501-
var length: UInt32 = 0
501+
var length: CInterop.SocketLength = 0
502502
return valueOrErrno(retryOnInterrupt: retryOnInterrupt) {
503503
system_accept(self.rawValue, nil, &length)
504504
}.map(SocketDescriptor.init(rawValue:))

0 commit comments

Comments
 (0)