mirror of
https://github.com/feschber/lan-mouse.git
synced 2026-04-14 01:31:28 +03:00
unlink socket in case it's left over from a crash
This commit is contained in:
@@ -51,6 +51,10 @@ impl FrontendAdapter {
|
|||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
let socket_path = Path::new(env::var("XDG_RUNTIME_DIR")?.as_str()).join("lan-mouse-socket.sock");
|
let socket_path = Path::new(env::var("XDG_RUNTIME_DIR")?.as_str()).join("lan-mouse-socket.sock");
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
|
log::debug!("remove socket: {:?}", socket_path);
|
||||||
|
#[cfg(unix)]
|
||||||
|
std::fs::remove_file(&socket_path).unwrap();
|
||||||
|
#[cfg(unix)]
|
||||||
let listener = UnixListener::bind(&socket_path)?;
|
let listener = UnixListener::bind(&socket_path)?;
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
|
|||||||
Reference in New Issue
Block a user