summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Brian Carlstrom <bdc@google.com> 2014-08-28 22:17:13 -0700
committer Brian Carlstrom <bdc@google.com> 2014-08-28 22:24:03 -0700
commitdebdda0262bfbcb966a89e693d933cc74eb412ac (patch)
tree285410fe6524ef9dce6428cbcbc68010531ff8bf
parent9ca7d1a973f463f6c53f0b9975c500370ab50ef4 (diff)
Fix Mac build
Bug: 17000769,16875245 Change-Id: Id5ff133e0c6c56db6972a187773c7e873b7062ee
-rw-r--r--runtime/gc/space/image_space.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index bf897b23d2..41c34c9bf5 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -89,8 +89,6 @@ static void RealPruneDexCache(const std::string& cache_dir_path) {
PLOG(WARNING) << "Unable to open " << cache_dir_path << " to delete it's contents";
return;
}
- int dir_fd = dirfd(cache_dir);
- CHECK_GE(dir_fd, 0);
for (struct dirent* de = readdir(cache_dir); de != nullptr; de = readdir(cache_dir)) {
const char* name = de->d_name;
@@ -105,8 +103,11 @@ static void RealPruneDexCache(const std::string& cache_dir_path) {
}
continue;
}
- if (TEMP_FAILURE_RETRY(unlinkat(dir_fd, name, 0)) != 0) {
- PLOG(ERROR) << "Unable to unlink " << cache_dir_path << "/" << name;
+ std::string cache_file(cache_dir_path);
+ cache_file += '/';
+ cache_file += name;
+ if (TEMP_FAILURE_RETRY(unlink(cache_file.c_str())) != 0) {
+ PLOG(ERROR) << "Unable to unlink " << cache_file;
continue;
}
}