Don't use TEMP_FAILURE_RETRY on close()
See https://lkml.org/lkml/2005/9/10/129 for details.
(cherry-picked from commit 95db36e128
)
Bug: 20501816
Change-Id: I38bf5052f44034c6f866d10d7d07187f0053a7a1
This commit is contained in:
parent
94a811ab19
commit
12c67f4dfe
1 changed files with 3 additions and 3 deletions
|
@ -51,7 +51,7 @@ bool ReadFileToString(const std::string& path, std::string* content) {
|
|||
return false;
|
||||
}
|
||||
bool result = ReadFdToString(fd, content);
|
||||
TEMP_FAILURE_RETRY(close(fd));
|
||||
close(fd);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ bool WriteStringToFile(const std::string& content, const std::string& path,
|
|||
ALOGE("android::WriteStringToFile write failed: %s", strerror(errno));
|
||||
return CleanUpAfterFailedWrite(path);
|
||||
}
|
||||
TEMP_FAILURE_RETRY(close(fd));
|
||||
close(fd);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
@ -116,7 +116,7 @@ bool WriteStringToFile(const std::string& content, const std::string& path) {
|
|||
}
|
||||
|
||||
bool result = WriteStringToFd(content, fd);
|
||||
TEMP_FAILURE_RETRY(close(fd));
|
||||
close(fd);
|
||||
return result || CleanUpAfterFailedWrite(path);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue