Skip to content

Commit 2214860

Browse files
committed
Auto merge of #24594 - doomsplayer:patch-2, r=alexcrichton
why use dummy implementation on linux?
2 parents 714bd49 + 4d6e2f5 commit 2214860

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/libstd/sys/common/net2.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,19 @@ impl TcpStream {
202202
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPALIVE,
203203
seconds as c_int)
204204
}
205-
#[cfg(any(target_os = "freebsd", target_os = "dragonfly"))]
205+
#[cfg(any(target_os = "freebsd",
206+
target_os = "dragonfly",
207+
target_os = "linux"))]
206208
fn set_tcp_keepalive(&self, seconds: u32) -> io::Result<()> {
207209
setsockopt(&self.inner, libc::IPPROTO_TCP, libc::TCP_KEEPIDLE,
208210
seconds as c_int)
209211
}
212+
210213
#[cfg(not(any(target_os = "macos",
211214
target_os = "ios",
212215
target_os = "freebsd",
213-
target_os = "dragonfly")))]
216+
target_os = "dragonfly",
217+
target_os = "linux")))]
214218
fn set_tcp_keepalive(&self, _seconds: u32) -> io::Result<()> {
215219
Ok(())
216220
}

0 commit comments

Comments
 (0)