mirror of
https://github.com/termux-pacman/termux-packages.git
synced 2025-12-28 06:30:31 +00:00
41 lines
1.6 KiB
Diff
41 lines
1.6 KiB
Diff
--- a/src/os/unix/udsocket/socket.rs
|
|
+++ b/src/os/unix/udsocket/socket.rs
|
|
@@ -293,7 +293,7 @@
|
|
let mut addr_buf_staging = unsafe { zeroed::<sockaddr_un>() };
|
|
// It's a void* so the doublecast is mandatory
|
|
hdr.msg_name = &mut addr_buf_staging as *mut _ as *mut _;
|
|
- hdr.msg_namelen = size_of_val(&addr_buf_staging).try_to::<u32>().unwrap();
|
|
+ hdr.msg_namelen = size_of_val(&addr_buf_staging).try_to::<libc::socklen_t>().unwrap();
|
|
fill_out_msghdr_r(&mut hdr, bufs, abuf.as_mut())?;
|
|
let (success, bytes_read) = unsafe {
|
|
let result = libc::recvmsg(self.as_raw_fd(), &mut hdr as *mut _, 0);
|
|
--- a/src/os/unix/udsocket/c_wrappers.rs
|
|
+++ b/src/os/unix/udsocket/c_wrappers.rs
|
|
@@ -51,7 +51,7 @@
|
|
// Double cast because you cannot cast a reference to a pointer of arbitrary type
|
|
// but you can cast any narrow pointer to any other narrow pointer
|
|
addr as *const _ as *const sockaddr,
|
|
- size_of::<sockaddr_un>() as u32,
|
|
+ size_of::<sockaddr_un>() as libc::socklen_t,
|
|
) != -1
|
|
};
|
|
if success {
|
|
@@ -70,7 +70,7 @@
|
|
libc::connect(
|
|
fd.0,
|
|
addr as *const _ as *const _,
|
|
- size_of::<sockaddr_un>() as u32,
|
|
+ size_of::<sockaddr_un>() as libc::socklen_t,
|
|
) != -1
|
|
};
|
|
if success {
|
|
@@ -101,7 +101,7 @@
|
|
SOL_SOCKET,
|
|
SO_PASSCRED,
|
|
&passcred as *const _ as *const _,
|
|
- size_of_val(&passcred) as u32,
|
|
+ size_of_val(&passcred) as libc::socklen_t,
|
|
) != -1
|
|
};
|
|
if success {
|