size vs stride fix

This commit is contained in:
Johannes Weiß committed 2017-04-28 15:46:52 +01:00
1 parent c223889cd5
commit 2a28806f16
1 file changed
+2 -2
+2 -2
View File
@@ -59,14 +59,14 @@ public class BaseSocket : Selectable {
level,
name,
&val,
socklen_t(MemoryLayout<T>.stride)
socklen_t(MemoryLayout.size(ofValue: val))
) != -1 else {
throw IOError(errno: errno, reason: "setsockopt failed")
}
}
public func getOption<T>(level: Int32, name: Int32) throws -> T {
var length = socklen_t(MemoryLayout<T>.stride)
var length = socklen_t(MemoryLayout<T>.size)
var val = UnsafeMutablePointer<T>.allocate(capacity: 1)
defer {
val.deinitialize()