diff options
author | Nick Kralevich <nnk@google.com> | 2015-05-20 08:59:21 -0700 |
---|---|---|
committer | Nick Kralevich <nnk@google.com> | 2015-05-23 16:03:06 +0000 |
commit | 12c67f4dfe1daf975e4c3f04211008b470206526 (patch) | |
tree | c37edf30cd4ac9a508b22e5f97cd477b6894f547 | |
parent | 94a811ab19006ec6c4d8057f3bf81d79308d28f6 (diff) | |
download | system_core-12c67f4dfe1daf975e4c3f04211008b470206526.zip system_core-12c67f4dfe1daf975e4c3f04211008b470206526.tar.gz system_core-12c67f4dfe1daf975e4c3f04211008b470206526.tar.bz2 |
Don't use TEMP_FAILURE_RETRY on close()
See https://lkml.org/lkml/2005/9/10/129 for details.
(cherry-picked from commit 95db36e1287988a7184cdcd87699ad07e068a639)
Bug: 20501816
Change-Id: I38bf5052f44034c6f866d10d7d07187f0053a7a1
-rw-r--r-- | base/file.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/base/file.cpp b/base/file.cpp index 6b19818..9a340b7 100644 --- a/base/file.cpp +++ b/base/file.cpp @@ -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); } |