From b7dbd864c42eb9619507521041eff16d48dfe16a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Sun, 21 Jan 2024 10:59:42 +0100 Subject: [PATCH] fix(unix): correctly delete sock in not already exist --- src/unix_socket.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unix_socket.rs b/src/unix_socket.rs index fe73647..7dae343 100644 --- a/src/unix_socket.rs +++ b/src/unix_socket.rs @@ -50,7 +50,7 @@ impl Stream for UnixListenerStream { pub async fn run_server(socket_path: &Path) -> Result { info!("Starting Unix socket server listening cnx on {:?}", socket_path); - let path_to_delete = socket_path.exists(); + let path_to_delete = !socket_path.exists(); let listener = UnixListener::bind(socket_path) .with_context(|| format!("Cannot create Unix socket server {:?}", socket_path))?;