Skip to content

Commit 866064d

Browse files
committed
Use socklen_t rather than u32, as they are not always the same.
e.g. on 32-bit Android targets.
1 parent cc19ecd commit 866064d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl VsockListener {
7272
bind(
7373
socket,
7474
&mut vsock_addr as *mut _ as *mut sockaddr,
75-
size_of::<sockaddr_vm>() as u32,
75+
size_of::<sockaddr_vm>() as socklen_t,
7676
)
7777
};
7878
if res < 0 {
@@ -236,7 +236,7 @@ impl VsockStream {
236236
connect(
237237
sock,
238238
&vsock_addr as *const _ as *const sockaddr,
239-
size_of::<sockaddr_vm>() as u32,
239+
size_of::<sockaddr_vm>() as socklen_t,
240240
)
241241
} < 0
242242
{
@@ -322,7 +322,7 @@ impl VsockStream {
322322
SOL_SOCKET,
323323
SO_SNDTIMEO,
324324
&timeout as *const _ as *const c_void,
325-
size_of::<timeval>() as u32,
325+
size_of::<timeval>() as socklen_t,
326326
)
327327
} < 0
328328
{
@@ -341,7 +341,7 @@ impl VsockStream {
341341
SOL_SOCKET,
342342
SO_RCVTIMEO,
343343
&timeout as *const _ as *const c_void,
344-
size_of::<timeval>() as u32,
344+
size_of::<timeval>() as socklen_t,
345345
)
346346
} < 0
347347
{

0 commit comments

Comments
 (0)