summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2016-02-08 16:26:33 -0800
committerYabin Cui <yabinc@google.com>2016-02-08 16:52:55 -0800
commit8e6f7227641e05dccfc29dad62e29e730ff8f5ca (patch)
tree8f869b06f61de44ef15c2e1430ba788b21f40c55 /base
parentd4ac11a57d37c56360e59ba75aa2f6ee777e5ed8 (diff)
downloadsystem_core-8e6f7227641e05dccfc29dad62e29e730ff8f5ca.tar.gz
system_core-8e6f7227641e05dccfc29dad62e29e730ff8f5ca.tar.bz2
system_core-8e6f7227641e05dccfc29dad62e29e730ff8f5ca.zip
libziparchive: port unit tests to darwin and windows.
Also use ReadFully to replace read, because read can return reading bytes less than requested. And use WriteFully to replace write. Bug: 26962895 Change-Id: Iff0b2bc6d925619a537f7fef682c2a7ad89a2dc2
Diffstat (limited to 'base')
-rw-r--r--base/file.cpp4
-rw-r--r--base/include/android-base/file.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/base/file.cpp b/base/file.cpp
index bcdfc5e99..da1adba19 100644
--- a/base/file.cpp
+++ b/base/file.cpp
@@ -29,10 +29,6 @@
#include "cutils/log.h"
#include "utils/Compat.h"
-#if !defined(_WIN32)
-#define O_BINARY 0
-#endif
-
namespace android {
namespace base {
diff --git a/base/include/android-base/file.h b/base/include/android-base/file.h
index 486befcbb..5342d9878 100644
--- a/base/include/android-base/file.h
+++ b/base/include/android-base/file.h
@@ -20,6 +20,10 @@
#include <sys/stat.h>
#include <string>
+#if !defined(_WIN32) && !defined(O_BINARY)
+#define O_BINARY 0
+#endif
+
namespace android {
namespace base {