windows.sendto fix (#15831)

This commit is contained in:
Marcos O 2023-06-14 18:24:16 +02:00 committed by GitHub
parent 496320d935
commit ff835cce10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5979,7 +5979,7 @@ pub fn sendto(
addrlen: socklen_t,
) SendToError!usize {
if (builtin.os.tag == .windows) {
switch (windows.ws2_32.sendto(sockfd, buf.ptr, buf.len, flags, dest_addr, addrlen)) {
switch (windows.sendto(sockfd, buf.ptr, buf.len, flags, dest_addr, addrlen)) {
windows.ws2_32.SOCKET_ERROR => switch (windows.ws2_32.WSAGetLastError()) {
.WSAEACCES => return error.AccessDenied,
.WSAEADDRNOTAVAIL => return error.AddressNotAvailable,