Merge "Remove sockets and FIFOS when removing files" into twrp2.4

This commit is contained in:
bigbiff bigbiff
2013-01-21 11:02:40 -06:00
committed by Gerrit Code Review
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1234,7 +1234,7 @@ bool TWPartition::Wipe_Data_Without_Wiping_Media() {
dir.append(de->d_name);
if (de->d_type == DT_DIR) {
TWFunc::removeDir(dir, false);
} else if (de->d_type == DT_REG || de->d_type == DT_LNK) {
} else if (de->d_type == DT_REG || de->d_type == DT_LNK || de->d_type == DT_FIFO || de->d_type == DT_SOCK) {
if (!unlink(dir.c_str()))
LOGI("Unable to unlink '%s'\n", dir.c_str());
}
+1 -1
View File
@@ -426,7 +426,7 @@ int TWFunc::removeDir(const string path, bool skipParent) {
else
LOGI("Unable to removeDir '%s': %s\n", new_path.c_str(), strerror(errno));
}
} else if (p->d_type == DT_REG || p->d_type == DT_LNK) {
} else if (p->d_type == DT_REG || p->d_type == DT_LNK || p->d_type == DT_FIFO || p->d_type == DT_SOCK) {
r = unlink(new_path.c_str());
if (!r)
LOGI("Unable to unlink '%s'\n", new_path.c_str());