Skip to content

Commit 45f05fc

Browse files
committed
Fix compilation on Windows
This was cherry-pick picked from the v0.5 branch, but never compiled properly due changed made to v0.5. Combine that with a broken CI, which we didn't know about, and you've got a broken v0.4.8 release.
1 parent 625c1dd commit 45f05fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/sys/windows.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use winapi::um::winsock2::{
3232
self as sock, u_long, POLLERR, POLLHUP, POLLRDNORM, POLLWRNORM, SD_BOTH, SD_RECEIVE, SD_SEND,
3333
WSAPOLLFD,
3434
};
35+
use winapi::um::winsock2::{SOCKET_ERROR, WSAEMSGSIZE, WSAESHUTDOWN};
3536

3637
use crate::{RecvFlags, SockAddr, TcpKeepalive, Type};
3738

@@ -469,7 +470,7 @@ pub(crate) fn recv_from(
469470
pub(crate) fn peek_sender(socket: Socket) -> io::Result<SockAddr> {
470471
// Safety: `recvfrom` initialises the `SockAddr` for us.
471472
let ((), sender) = unsafe {
472-
SockAddr::try_init(|storage, addrlen| {
473+
SockAddr::init(|storage, addrlen| {
473474
let res = syscall!(
474475
recvfrom(
475476
socket,

0 commit comments

Comments
 (0)