diff --git a/server/src/main.rs b/server/src/main.rs index 5e80cf7..c0b78e5 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -80,6 +80,10 @@ impl Listener { async fn bind(addr: &str, unix: bool) -> Result { #[cfg(unix)] if unix { + if std::fs::metadata(addr).is_ok() { + println!("attempting to remove old socket {:?}", addr); + std::fs::remove_file(addr)?; + } return Ok(Listener::Unix(UnixListener::bind(addr)?)); } #[cfg(not(unix))]