Skip to content

Commit fa792ff

Browse files
author
Bryant Mairs
committed
Use libc::linger
1 parent 83602fe commit fa792ff

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/sys/socket/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -799,13 +799,6 @@ pub fn send(fd: RawFd, buf: &[u8], flags: MsgFlags) -> Result<usize> {
799799
Errno::result(ret).map(|r| r as usize)
800800
}
801801

802-
#[repr(C)]
803-
#[derive(Clone, Copy, Debug)]
804-
pub struct linger {
805-
pub l_onoff: c_int,
806-
pub l_linger: c_int
807-
}
808-
809802
#[repr(C)]
810803
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
811804
pub struct ucred {

src/sys/socket/sockopt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ macro_rules! sockopt_impl {
132132
sockopt_impl!(Both, ReuseAddr, libc::SOL_SOCKET, libc::SO_REUSEADDR, bool);
133133
sockopt_impl!(Both, ReusePort, libc::SOL_SOCKET, libc::SO_REUSEPORT, bool);
134134
sockopt_impl!(Both, TcpNoDelay, libc::IPPROTO_TCP, libc::TCP_NODELAY, bool);
135-
sockopt_impl!(Both, Linger, libc::SOL_SOCKET, libc::SO_LINGER, super::linger);
135+
sockopt_impl!(Both, Linger, libc::SOL_SOCKET, libc::SO_LINGER, libc::linger);
136136
sockopt_impl!(SetOnly, IpAddMembership, libc::IPPROTO_IP, libc::IP_ADD_MEMBERSHIP, super::ip_mreq);
137137
sockopt_impl!(SetOnly, IpDropMembership, libc::IPPROTO_IP, libc::IP_DROP_MEMBERSHIP, super::ip_mreq);
138138
#[cfg(not(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "netbsd", target_os = "openbsd")))]

0 commit comments

Comments
 (0)