summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-05-15 17:31:15 -0700
committerElliott Hughes <enh@google.com>2017-05-15 17:31:15 -0700
commit282ec458be176775446935ea757514d019cd4a5b (patch)
treee0b228148b0a824cbd042e993e1a0274e116459f
parent3cfc1ab89dd841c69f0d477e75d534329a7a2e47 (diff)
downloadcore-282ec458be176775446935ea757514d019cd4a5b.tar.gz
Remove libbase's trivial libutils-headers dependency.
Bug: N/A Test: builds Change-Id: I59eb464a0127564a42775bf19b516ad8a53ee235
-rw-r--r--base/Android.bp1
-rw-r--r--base/file.cpp5
2 files changed, 3 insertions, 3 deletions
diff --git a/base/Android.bp b/base/Android.bp
index 81b96db43..b636dc31c 100644
--- a/base/Android.bp
+++ b/base/Android.bp
@@ -53,7 +53,6 @@ cc_library {
header_libs: [
"libbase_headers",
- "libutils_headers",
],
export_header_lib_headers: ["libbase_headers"],
diff --git a/base/file.cpp b/base/file.cpp
index 7fbebc538..a2f28878e 100644
--- a/base/file.cpp
+++ b/base/file.cpp
@@ -32,13 +32,14 @@
#include "android-base/macros.h" // For TEMP_FAILURE_RETRY on Darwin.
#include "android-base/unique_fd.h"
#include "android-base/utf8.h"
-#include "utils/Compat.h"
#if defined(__APPLE__)
#include <mach-o/dyld.h>
#endif
#if defined(_WIN32)
#include <windows.h>
+#define O_CLOEXEC O_NOINHERIT
+#define O_NOFOLLOW 0
#endif
namespace android {
@@ -133,7 +134,7 @@ bool WriteStringToFile(const std::string& content, const std::string& path,
bool follow_symlinks) {
int flags = O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_BINARY |
(follow_symlinks ? 0 : O_NOFOLLOW);
- android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(path.c_str(), flags, DEFFILEMODE)));
+ android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(path.c_str(), flags, 0666)));
if (fd == -1) {
return false;
}