Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
node: Remove control socket at the end
Alexis Sellier committed 3 years ago
commit d324eab377d44c1b15c30562e9751421f13a9659
parent fd5ac7f6afdc0bece1311f66d39277c7aae21855
1 file changed +2 -3
modified radicle-node/src/control.rs
@@ -27,8 +27,6 @@ pub fn listen<P: AsRef<Path>, H: Handle<Error = client::handle::Error>>(
    path: P,
    mut handle: H,
) -> Result<(), Error> {
-
    // Remove the socket file on startup before rebinding.
-
    fs::remove_file(&path).ok();
    fs::create_dir_all(
        path.as_ref()
            .parent()
@@ -39,7 +37,7 @@ pub fn listen<P: AsRef<Path>, H: Handle<Error = client::handle::Error>>(
    log::info!("Binding control socket {}..", path.as_ref().display());

    // TODO: Move socket binding to main thread.
-
    let listener = UnixListener::bind(path).map_err(Error::Bind)?;
+
    let listener = UnixListener::bind(&path).map_err(Error::Bind)?;
    for incoming in listener.incoming() {
        match incoming {
            Ok(mut stream) => {
@@ -65,6 +63,7 @@ pub fn listen<P: AsRef<Path>, H: Handle<Error = client::handle::Error>>(
        }
    }
    log::debug!("Exiting control loop..");
+
    fs::remove_file(&path).ok();

    Ok(())
}