From ff79dcb21935e9892f46b3f95db188b64488d4a0 Mon Sep 17 00:00:00 2001 From: Bryant Mairs Date: Wed, 6 Dec 2017 07:52:22 -0800 Subject: Use libc::linger --- src/sys/socket/mod.rs | 7 ------- src/sys/socket/sockopt.rs | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index 2102c1ce..bf2e3308 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -800,13 +800,6 @@ pub fn send(fd: RawFd, buf: &[u8], flags: MsgFlags) -> Result { Errno::result(ret).map(|r| r as usize) } -#[repr(C)] -#[derive(Clone, Copy, Debug)] -pub struct linger { - pub l_onoff: c_int, - pub l_linger: c_int -} - #[repr(C)] #[derive(Clone, Copy, PartialEq, Eq, Debug)] pub struct ucred { diff --git a/src/sys/socket/sockopt.rs b/src/sys/socket/sockopt.rs index 4741ec66..fa8d71e2 100644 --- a/src/sys/socket/sockopt.rs +++ b/src/sys/socket/sockopt.rs @@ -132,7 +132,7 @@ macro_rules! sockopt_impl { sockopt_impl!(Both, ReuseAddr, libc::SOL_SOCKET, libc::SO_REUSEADDR, bool); sockopt_impl!(Both, ReusePort, libc::SOL_SOCKET, libc::SO_REUSEPORT, bool); sockopt_impl!(Both, TcpNoDelay, libc::IPPROTO_TCP, libc::TCP_NODELAY, bool); -sockopt_impl!(Both, Linger, libc::SOL_SOCKET, libc::SO_LINGER, super::linger); +sockopt_impl!(Both, Linger, libc::SOL_SOCKET, libc::SO_LINGER, libc::linger); sockopt_impl!(SetOnly, IpAddMembership, libc::IPPROTO_IP, libc::IP_ADD_MEMBERSHIP, super::ip_mreq); sockopt_impl!(SetOnly, IpDropMembership, libc::IPPROTO_IP, libc::IP_DROP_MEMBERSHIP, super::ip_mreq); #[cfg(not(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd")))] -- cgit v1.2.3