correct server socket differentiation
This commit is contained in:
parent
9e9bc2b0ae
commit
0cfa9fc07a
@ -35,7 +35,12 @@ mod platform {
|
|||||||
pub fn server_addr(sock_name: &str) -> PathBuf {
|
pub fn server_addr(sock_name: &str) -> PathBuf {
|
||||||
let mut path = dirs::runtime_dir()
|
let mut path = dirs::runtime_dir()
|
||||||
.unwrap_or_else(|| PathBuf::from("/tmp"));
|
.unwrap_or_else(|| PathBuf::from("/tmp"));
|
||||||
|
if cfg!(debug_assertions) {
|
||||||
|
path.push(format!("{sock_name}.dev.sock"))
|
||||||
|
}
|
||||||
|
else {
|
||||||
path.push(format!("{sock_name}.sock"));
|
path.push(format!("{sock_name}.sock"));
|
||||||
|
}
|
||||||
path
|
path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -44,6 +49,11 @@ mod platform {
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
mod platform {
|
mod platform {
|
||||||
pub fn server_addr(sock_name: &str) -> String {
|
pub fn server_addr(sock_name: &str) -> String {
|
||||||
|
if cfg!(debug_assertions) {
|
||||||
|
format!(r"\\.\pipe\{sock_name}.dev")
|
||||||
|
}
|
||||||
|
else {
|
||||||
format!(r"\\.\pipe\{sock_name}")
|
format!(r"\\.\pipe\{sock_name}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user