diff --git a/Cargo.toml b/Cargo.toml index eb31c29b..b661f2e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,8 +70,6 @@ all = [] [package.metadata.cargo_check_external_types] allowed_external_types = [ # Referenced via a type alias. - "libc::c_int", - "libc::primitives::c_int", # libc::c_int isn't always detected. "libc::socklen_t", "libc::*::socklen_t", # libc::socklen_t isn't always detected. "libc::sa_family_t", diff --git a/src/sys/unix.rs b/src/sys/unix.rs index e3ec1da7..3787ce00 100644 --- a/src/sys/unix.rs +++ b/src/sys/unix.rs @@ -83,7 +83,7 @@ use crate::{Domain, Protocol, SockAddr, SockAddrStorage, TcpKeepalive, Type}; #[cfg(not(target_os = "redox"))] use crate::{MsgHdr, MsgHdrMut, RecvFlags}; -pub(crate) use libc::c_int; +pub(crate) use std::os::raw::c_int; // Used in `Domain`. pub(crate) use libc::{AF_INET, AF_INET6, AF_UNIX}; @@ -730,7 +730,7 @@ pub(crate) fn set_msghdr_control(msg: &mut msghdr, ptr: *mut libc::c_void, len: } #[cfg(not(target_os = "redox"))] -pub(crate) fn set_msghdr_flags(msg: &mut msghdr, flags: libc::c_int) { +pub(crate) fn set_msghdr_flags(msg: &mut msghdr, flags: c_int) { msg.msg_flags = flags; } @@ -1002,7 +1002,7 @@ pub(crate) fn set_nonblocking(fd: Socket, nonblocking: bool) -> io::Result<()> { fd, libc::SOL_SOCKET, libc::SO_NONBLOCK, - nonblocking as libc::c_int, + nonblocking as c_int, ) } }