1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-28 04:44:30 +00:00
treble_evolution/patches/trebledroid/platform_system_vold/0001-Allow-deletion-of-symlink.patch
2024-03-10 06:48:11 +00:00

26 lines
808 B
Diff

From b00fbfc470c6f91224429178bc24c30f9146af05 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 17 Feb 2018 19:39:38 +0100
Subject: [PATCH 1/5] Allow deletion of symlink
Change-Id: I9731895f88729072297f753088583aabbe6990f4
---
FsCrypt.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/FsCrypt.cpp b/FsCrypt.cpp
index 903d36bf..74e6ad1d 100644
--- a/FsCrypt.cpp
+++ b/FsCrypt.cpp
@@ -351,6 +351,7 @@ static bool prepare_dir_with_policy(const std::string& dir, mode_t mode, uid_t u
static bool destroy_dir(const std::string& dir) {
LOG(DEBUG) << "Destroying: " << dir;
if (rmdir(dir.c_str()) != 0 && errno != ENOENT) {
+ if(unlink(dir.c_str()) == 0) return true;
PLOG(ERROR) << "Failed to destroy " << dir;
return false;
}
--
2.25.1