std.net: fix setsockopt call

master
Luna 2019-12-01 13:17:52 -03:00 committed by Andrew Kelley
parent 5efc0ea89e
commit 50e6a27c29
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9
1 changed files with 2 additions and 3 deletions

View File

@ -1326,13 +1326,12 @@ pub const StreamServer = struct {
}
if (self.reuse_address) {
var optval: c_int = 1;
var opt = [_]u8{1} ** @sizeOf(c_int);
try os.setsockopt(
self.sockfd.?,
os.SOL_SOCKET,
os.SO_REUSEADDR,
@ptrCast([*]const u8, &optval),
@sizeOf(c_int),
&opt,
);
}