Remove unnecessary TEMP_FAILURE_RETRY.
unlink, rmdir, rename and closedir do not generate EINTR.
Change-Id: Ia5daab3e19f7373d7c27cdb6a800351c86b5a4e5
diff --git a/runtime/gc/space/image_space_fs.h b/runtime/gc/space/image_space_fs.h
index 5237466..eac52f7 100644
--- a/runtime/gc/space/image_space_fs.h
+++ b/runtime/gc/space/image_space_fs.h
@@ -62,7 +62,7 @@
if (recurse) {
DeleteDirectoryContents(file, recurse);
// Try to rmdir the directory.
- if (TEMP_FAILURE_RETRY(rmdir(file.c_str())) != 0) {
+ if (rmdir(file.c_str()) != 0) {
PLOG(ERROR) << "Unable to rmdir " << file;
}
}
@@ -71,12 +71,12 @@
}
} else {
// Try to unlink the file.
- if (TEMP_FAILURE_RETRY(unlink(file.c_str())) != 0) {
+ if (unlink(file.c_str()) != 0) {
PLOG(ERROR) << "Unable to unlink " << file;
}
}
}
- CHECK_EQ(0, TEMP_FAILURE_RETRY(closedir(c_dir))) << "Unable to close directory.";
+ CHECK_EQ(0, closedir(c_dir)) << "Unable to close directory.";
}
static bool HasContent(const char* dir) {
@@ -95,10 +95,10 @@
continue;
}
// Something here.
- CHECK_EQ(0, TEMP_FAILURE_RETRY(closedir(c_dir))) << "Unable to close directory.";
+ CHECK_EQ(0, closedir(c_dir)) << "Unable to close directory.";
return true;
}
- CHECK_EQ(0, TEMP_FAILURE_RETRY(closedir(c_dir))) << "Unable to close directory.";
+ CHECK_EQ(0, closedir(c_dir)) << "Unable to close directory.";
return false;
}
@@ -115,7 +115,7 @@
}
}
if (OS::DirectoryExists(dir.c_str())) {
- if (TEMP_FAILURE_RETRY(rmdir(dir.c_str())) != 0) {
+ if (rmdir(dir.c_str()) != 0) {
PLOG(ERROR) << "Unable to rmdir " << dir;
return;
}
@@ -136,7 +136,7 @@
return;
}
- if (TEMP_FAILURE_RETRY(rename(src, trg)) != 0) {
+ if (rename(src, trg) != 0) {
PLOG(ERROR) << "Could not rename OTA cache " << src << " to target " << trg;
}
}
diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc
index ce892f3..32e95e7 100644
--- a/runtime/oat_file_assistant.cc
+++ b/runtime/oat_file_assistant.cc
@@ -77,7 +77,7 @@
OatFileAssistant::~OatFileAssistant() {
// Clean up the lock file.
if (flock_.HasFile()) {
- TEMP_FAILURE_RETRY(unlink(flock_.GetFile()->GetPath().c_str()));
+ unlink(flock_.GetFile()->GetPath().c_str());
}
}
@@ -109,7 +109,7 @@
std::string lock_file_name = *OatFileName() + ".flock";
if (!flock_.Init(lock_file_name.c_str(), error_msg)) {
- TEMP_FAILURE_RETRY(unlink(lock_file_name.c_str()));
+ unlink(lock_file_name.c_str());
return false;
}
return true;
@@ -613,7 +613,7 @@
if (!Exec(argv, error_msg)) {
// Manually delete the file. This ensures there is no garbage left over if
// the process unexpectedly died.
- TEMP_FAILURE_RETRY(unlink(oat_file_name.c_str()));
+ unlink(oat_file_name.c_str());
return kUpdateFailed;
}
@@ -673,13 +673,13 @@
// Manually delete the file. This ensures there is no garbage left over if
// the process unexpectedly died.
oat_file->Erase();
- TEMP_FAILURE_RETRY(unlink(oat_file_name.c_str()));
+ unlink(oat_file_name.c_str());
return kUpdateFailed;
}
if (oat_file->FlushCloseOrErase() != 0) {
*error_msg = "Unable to close oat file " + oat_file_name;
- TEMP_FAILURE_RETRY(unlink(oat_file_name.c_str()));
+ unlink(oat_file_name.c_str());
return kUpdateFailed;
}