aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2020-05-25 19:28:42 -0400
committerJesse Luehrs <doy@tozt.net>2020-05-25 19:28:42 -0400
commit6e57cb466f2ccd7b0eb4de216f45d3eddfcb3665 (patch)
tree7fbfae3498f7778538e79397baa8fff4686f1b11 /src
parent23dc951eccc173f988f54e567c3275244e5f7a0b (diff)
downloadrbw-6e57cb466f2ccd7b0eb4de216f45d3eddfcb3665.tar.gz
rbw-6e57cb466f2ccd7b0eb4de216f45d3eddfcb3665.zip
also suppress error if the socket file doesn't exist
Diffstat (limited to 'src')
-rw-r--r--src/bin/rbw/actions.rs14
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()),
+ },
}
}