fix(unix): correctly delete sock in not already exist
This commit is contained in:
parent
2994618fad
commit
b7dbd864c4
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ impl Stream for UnixListenerStream {
|
||||||
pub async fn run_server(socket_path: &Path) -> Result<UnixListenerStream, anyhow::Error> {
|
pub async fn run_server(socket_path: &Path) -> Result<UnixListenerStream, anyhow::Error> {
|
||||||
info!("Starting Unix socket server listening cnx on {:?}", socket_path);
|
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)
|
let listener = UnixListener::bind(socket_path)
|
||||||
.with_context(|| format!("Cannot create Unix socket server {:?}", socket_path))?;
|
.with_context(|| format!("Cannot create Unix socket server {:?}", socket_path))?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue