diff options
author | Andrew Walbran <qwandor@google.com> | 2020-09-29 15:07:49 +0100 |
---|---|---|
committer | Andrew Walbran <qwandor@google.com> | 2020-10-20 12:49:38 +0100 |
commit | fcaa523d015c64924f793d38c1584f7f1a3efaf8 (patch) | |
tree | 3baaa60552cb80824ef47c0db18fa25cc64d2152 /src/lib.rs | |
parent | 641348654deac902ddb0212cbb414c516d37ff49 (diff) | |
download | vsock-fcaa523d015c64924f793d38c1584f7f1a3efaf8.tar.gz |
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
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -72,7 +72,7 @@ impl VsockListener { bind( socket, &mut vsock_addr as *mut _ as *mut sockaddr, - size_of::<sockaddr_vm>() as u32, + size_of::<sockaddr_vm>() as socklen_t, ) }; if res < 0 { @@ -234,7 +234,7 @@ impl VsockStream { connect( sock, &vsock_addr as *const _ as *const sockaddr, - size_of::<sockaddr_vm>() as u32, + size_of::<sockaddr_vm>() as socklen_t, ) } < 0 { @@ -320,7 +320,7 @@ impl VsockStream { SOL_SOCKET, SO_SNDTIMEO, &timeout as *const _ as *const c_void, - size_of::<timeval>() as u32, + size_of::<timeval>() as socklen_t, ) } < 0 { @@ -339,7 +339,7 @@ impl VsockStream { SOL_SOCKET, SO_RCVTIMEO, &timeout as *const _ as *const c_void, - size_of::<timeval>() as u32, + size_of::<timeval>() as socklen_t, ) } < 0 { |