unlink socket in case it's left over from a crash

This commit is contained in:
Ferdinand Schober
2023-09-19 21:10:45 +02:00
parent b839097cb2
commit 3b09abb532

View File

@@ -51,6 +51,10 @@ impl FrontendAdapter {
#[cfg(unix)]
let socket_path = Path::new(env::var("XDG_RUNTIME_DIR")?.as_str()).join("lan-mouse-socket.sock");
#[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)?;
#[cfg(windows)]