diff options
author | Jesse Luehrs <doy@tozt.net> | 2020-05-25 19:28:42 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2020-05-25 19:28:42 -0400 |
commit | 6e57cb466f2ccd7b0eb4de216f45d3eddfcb3665 (patch) | |
tree | 7fbfae3498f7778538e79397baa8fff4686f1b11 | |
parent | 23dc951eccc173f988f54e567c3275244e5f7a0b (diff) | |
download | rbw-6e57cb466f2ccd7b0eb4de216f45d3eddfcb3665.tar.gz rbw-6e57cb466f2ccd7b0eb4de216f45d3eddfcb3665.zip |
also suppress error if the socket file doesn't exist
-rw-r--r-- | src/bin/rbw/actions.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/bin/rbw/actions.rs b/src/bin/rbw/actions.rs index caeb636..035ebe6 100644 --- a/src/bin/rbw/actions.rs +++ b/src/bin/rbw/actions.rs @@ -31,13 +31,13 @@ pub fn quit() -> anyhow::Result<()> { wait_for_exit(pid)?; Ok(()) } - Err(e) => { - if e.kind() == std::io::ErrorKind::ConnectionRefused { - Ok(()) - } else { - Err(e.into()) - } - } + Err(e) => match e.kind() { + // if the socket doesn't exist, or the socket exists but nothing + // is listening on it, the agent must already be not running + std::io::ErrorKind::ConnectionRefused + | std::io::ErrorKind::NotFound => Ok(()), + _ => Err(e.into()), + }, } } |