Skip to content

Commit 08b7b70

Browse files
authored
Merge pull request #301 from L-jasmine/dev/more_os
Compatibility with non-Unix and non-Windows platforms.
2 parents 5037856 + 55e7b70 commit 08b7b70

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/conn/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ impl Conn {
913913
{
914914
Stream::connect_socket(_path.to_owned()).await?
915915
}
916-
#[cfg(target_os = "windows")]
916+
#[cfg(not(unix))]
917917
return Err(crate::DriverError::NamedPipesDisabled.into());
918918
} else {
919919
let keepalive = opts

src/io/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use bytes::BytesMut;
1212
use futures_core::{ready, stream};
1313
use mysql_common::proto::codec::PacketCodec as PacketCodecInner;
1414
use pin_project::pin_project;
15+
#[cfg(any(unix, windows))]
1516
use socket2::{Socket as Socket2Socket, TcpKeepalive};
1617
#[cfg(unix)]
1718
use tokio::io::AsyncWriteExt;
@@ -378,6 +379,7 @@ impl Stream {
378379
}
379380
};
380381

382+
#[cfg(any(unix, windows))]
381383
if let Some(duration) = keepalive {
382384
#[cfg(unix)]
383385
let socket = {

0 commit comments

Comments
 (0)