Skip to content

Commit 09d8e6b

Browse files
DarksonnThomasdezeeuw
authored andcommitted
Try to get rid of libc::c_int
1 parent 10e7cfd commit 09d8e6b

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ all = []
7070
[package.metadata.cargo_check_external_types]
7171
allowed_external_types = [
7272
# Referenced via a type alias.
73-
"libc::c_int",
74-
"libc::primitives::c_int", # libc::c_int isn't always detected.
7573
"libc::socklen_t",
7674
"libc::*::socklen_t", # libc::socklen_t isn't always detected.
7775
"libc::sa_family_t",

src/sys/unix.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ use crate::{Domain, Protocol, SockAddr, SockAddrStorage, TcpKeepalive, Type};
8383
#[cfg(not(target_os = "redox"))]
8484
use crate::{MsgHdr, MsgHdrMut, RecvFlags};
8585

86-
pub(crate) use libc::c_int;
86+
pub(crate) use core::os::raw::c_int;
8787

8888
// Used in `Domain`.
8989
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:
730730
}
731731

732732
#[cfg(not(target_os = "redox"))]
733-
pub(crate) fn set_msghdr_flags(msg: &mut msghdr, flags: libc::c_int) {
733+
pub(crate) fn set_msghdr_flags(msg: &mut msghdr, flags: c_int) {
734734
msg.msg_flags = flags;
735735
}
736736

@@ -1002,7 +1002,7 @@ pub(crate) fn set_nonblocking(fd: Socket, nonblocking: bool) -> io::Result<()> {
10021002
fd,
10031003
libc::SOL_SOCKET,
10041004
libc::SO_NONBLOCK,
1005-
nonblocking as libc::c_int,
1005+
nonblocking as c_int,
10061006
)
10071007
}
10081008
}

0 commit comments

Comments
 (0)