diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-03-05 12:59:49 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2018-03-06 14:06:22 -0300 |
| commit | 805c34bd97323457425eab2adc335ca5290e16a9 (patch) | |
| tree | 507ea31953f78edb5463579cbccafc2f9b997686 | |
| parent | f8382c8951460bdb98f0eac7cfc0916afdf7d1f6 (diff) | |
| download | mullvadvpn-805c34bd97323457425eab2adc335ca5290e16a9.tar.xz mullvadvpn-805c34bd97323457425eab2adc335ca5290e16a9.zip | |
Forcibly remove old backup of tunnel log file
| -rw-r--r-- | mullvad-daemon/src/main.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mullvad-daemon/src/main.rs b/mullvad-daemon/src/main.rs index 78daca509b..37f36b7a6c 100644 --- a/mullvad-daemon/src/main.rs +++ b/mullvad-daemon/src/main.rs @@ -671,12 +671,10 @@ impl Daemon { let mut backup = log_file.clone(); backup.set_extension("old.log"); - if backup.exists() { - // Try to remove file first, in case rename fails to overwrite it - fs::remove_file(&backup).unwrap_or_else(|error| { - warn!("Failed to remove old backup of tunnel log file ({})", error); - }); - } + // Try to remove file first, in case rename fails to overwrite it + fs::remove_file(&backup).unwrap_or_else(|error| { + warn!("Failed to remove old backup of tunnel log file ({})", error); + }); fs::rename(log_file, backup).unwrap_or_else(|error| { warn!( |
