remove check for casting size to u32

This commit is contained in:
Ryan Heywood 2025-07-11 20:42:20 -04:00
parent 3266a7fccf
commit d942d615d5
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
1 changed files with 3 additions and 1 deletions

View File

@ -159,12 +159,14 @@ pub use libc::sockaddr_vm;
// This function is unsafe since we have to pass it a C-style union.
pub unsafe fn connect(fd: RawFd, sockaddr: *mut libc::sockaddr, size: usize) -> Result<()> {
/*
let size = u32::try_from(size).context(format_args!(
"connect(..., size = {size}) has size > {}",
u32::MAX
))?;
*/
match unsafe { libc::connect(fd, sockaddr, size) } {
match unsafe { libc::connect(fd, sockaddr, size as u32) } {
0 => Ok(()),
-1 => ctx_os_error(format_args!("error calling connect({fd}, ...)")),
n => unreachable!("connect({fd}, ...) returned bad value: {n}"),