Skip to content

Commit

Permalink
fix(unix): correctly delete sock in not already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
erebe committed Jan 21, 2024
1 parent 2994618 commit b7dbd86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unix_socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl Stream for UnixListenerStream {
pub async fn run_server(socket_path: &Path) -> Result<UnixListenerStream, anyhow::Error> {
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))?;

Expand Down

0 comments on commit b7dbd86

Please sign in to comment.