diff options
| -rw-r--r-- | mullvad-daemon/src/rpc_info.rs | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/mullvad-daemon/src/rpc_info.rs b/mullvad-daemon/src/rpc_info.rs index e4df5ee184..43a573d8bb 100644 --- a/mullvad-daemon/src/rpc_info.rs +++ b/mullvad-daemon/src/rpc_info.rs @@ -37,9 +37,12 @@ lazy_static! { /// Tries to connect to another daemon and perform a simple RPC call. If it fails, assumes the /// other daemon has stopped. pub fn is_another_instance_running() -> bool { - let rpc_file_exists = RPC_ADDRESS_FILE_PATH.as_path().exists(); - - rpc_file_exists && other_daemon_responds() + if let Err(message) = call_other_daemon() { + info!("{}; assuming it has stopped", message); + false + } else { + true + } } /// Writes down the RPC connection info to some API to a file. @@ -72,15 +75,6 @@ pub fn remove() -> Result<()> { } } -fn other_daemon_responds() -> bool { - if let Err(message) = call_other_daemon() { - info!("{}; assuming it has stopped", message); - false - } else { - true - } -} - fn call_other_daemon() -> result::Result<(), String> { let method = "get_state"; let args: [u8; 0] = []; |
