Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use c_int type for SO_SNDBUF (#355) #357

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/platform/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ impl OsIpcSender {
/// Some of it is reserved by the kernel for bookkeeping.
fn get_system_sendbuf_size(&self) -> Result<usize, UnixError> {
unsafe {
let mut socket_sendbuf_size: usize = 0;
let mut socket_sendbuf_size_len = mem::size_of::<usize>() as socklen_t;
let mut socket_sendbuf_size: c_int = 0;
let mut socket_sendbuf_size_len = mem::size_of::<c_int>() as socklen_t;
if getsockopt(
self.fd.0,
libc::SOL_SOCKET,
Expand All @@ -225,7 +225,7 @@ impl OsIpcSender {
{
return Err(UnixError::last());
}
Ok(socket_sendbuf_size)
Ok(socket_sendbuf_size.try_into().unwrap())
}
}

Expand Down