~vpzom/shoved

b83a894a36fb4e31512adbe178d3f42650845faf — Colin Reeder 1 year, 19 days ago c3645f0
Ignore NotFound when removing socket (since it might already be gone)
1 files changed, 10 insertions(+), 1 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +10 -1
@@ 299,7 299,16 @@ async fn main() {
        path
    };

    std::fs::remove_file(&client_socket_path).unwrap();
    match std::fs::remove_file(&client_socket_path) {
        Ok(_) => {}
        Err(err) => {
            if err.kind() == std::io::ErrorKind::NotFound {
                // ok
            } else {
                panic!("Failed to remove socket: {:?}", err);
            }
        }
    }

    let client_listener = tokio::net::UnixListener::bind(client_socket_path).unwrap();