aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2018-01-18 04:12:54 -0600
committerSamuel Holland <samuel@sholland.org>2018-01-18 04:12:54 -0600
commit8baff42ff1cecf2c87f356d495662d7e150a3810 (patch)
tree7e85bfe3a7c6cf8d43bd531d19af180e5b6c1b8b /app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java
parentWgQuickBackend: Always pass the full path to wg-quick (diff)
downloadwireguard-android-8baff42ff1cecf2c87f356d495662d7e150a3810.tar.xz
wireguard-android-8baff42ff1cecf2c87f356d495662d7e150a3810.zip
FileConfigStore: Warn for deletion failure in exception path
There's nothing we can do about it at this point; we're already rolling back changes. Signed-off-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to '')
-rw-r--r--app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java b/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java
index f5cd01f0..ea5baf6d 100644
--- a/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java
+++ b/app/src/main/java/com/wireguard/android/configStore/FileConfigStore.java
@@ -77,7 +77,8 @@ public final class FileConfigStore implements ConfigStore {
if (!replacementFile.createNewFile())
throw new IOException("Configuration for " + replacement + " already exists");
if (!file.renameTo(replacementFile)) {
- replacementFile.delete();
+ if (!replacementFile.delete())
+ Log.w(TAG, "Couldn't delete marker file for new name " + replacement);
throw new IOException("Cannot rename configuration file " + file.getName());
}
}