From fcaa523d015c64924f793d38c1584f7f1a3efaf8 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Tue, 29 Sep 2020 15:07:49 +0100 Subject: Use socklen_t rather than u32, as they are not always the same. e.g. on 32-bit Android targets. Bug: 171249434 Test: mm Change-Id: I1f0c8d37021b778a4db7738f2eb37c25dcac3983 --- METADATA | 1 + src/lib.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/METADATA b/METADATA index f407b00..be7a313 100644 --- a/METADATA +++ b/METADATA @@ -16,4 +16,5 @@ third_party { month: 9 day: 28 } + local_modifications: "Cherry-picked https://github.com/qwandor/vsock-rs/commit/4f73c26fc9a95e36e3ac4d304a02b6a424d7bcfd to fix Android build. This should be included in the next upstream release." } diff --git a/src/lib.rs b/src/lib.rs index ec059ce..97055e7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -72,7 +72,7 @@ impl VsockListener { bind( socket, &mut vsock_addr as *mut _ as *mut sockaddr, - size_of::() as u32, + size_of::() as socklen_t, ) }; if res < 0 { @@ -234,7 +234,7 @@ impl VsockStream { connect( sock, &vsock_addr as *const _ as *const sockaddr, - size_of::() as u32, + size_of::() as socklen_t, ) } < 0 { @@ -320,7 +320,7 @@ impl VsockStream { SOL_SOCKET, SO_SNDTIMEO, &timeout as *const _ as *const c_void, - size_of::() as u32, + size_of::() as socklen_t, ) } < 0 { @@ -339,7 +339,7 @@ impl VsockStream { SOL_SOCKET, SO_RCVTIMEO, &timeout as *const _ as *const c_void, - size_of::() as u32, + size_of::() as socklen_t, ) } < 0 { -- cgit v1.2.3