summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Beare <bruce.j.beare@intel.com>2011-06-06 10:50:57 -0700
committerDavid 'Digit' Turner <digit@google.com>2011-06-09 20:51:34 +0200
commit372191f2b87d90acfb25db5c938ac96f861c2c04 (patch)
tree7259e615d1996e190ad080611feb2fd2bd93354c
parenta3394df8d7e5a6b2f1ee61d8a61b8baac255eff1 (diff)
downloadandroid_dalvik-372191f2b87d90acfb25db5c938ac96f861c2c04.tar.gz
android_dalvik-372191f2b87d90acfb25db5c938ac96f861c2c04.tar.bz2
android_dalvik-372191f2b87d90acfb25db5c938ac96f861c2c04.zip
Only use O_BINARY if it is defined (windows compatibility)
Change-Id: Iaa3c0812ef4d90d46b4031be7f4faca84c7d7200 Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
-rw-r--r--libdex/CmdUtils.c3
-rw-r--r--libdex/ZipArchive.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/libdex/CmdUtils.c b/libdex/CmdUtils.c
index 8ce0d4b31..e8fc635f9 100644
--- a/libdex/CmdUtils.c
+++ b/libdex/CmdUtils.c
@@ -160,6 +160,9 @@ UnzipToFileResult dexOpenAndMap(const char* fileName, const char* tempFileName,
/*
* Pop open the (presumed) DEX file.
*/
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
fd = open(fileName, O_RDONLY | O_BINARY);
if (fd < 0) {
if (!quiet) {
diff --git a/libdex/ZipArchive.c b/libdex/ZipArchive.c
index efe9f79ac..7feb417b8 100644
--- a/libdex/ZipArchive.c
+++ b/libdex/ZipArchive.c
@@ -341,6 +341,9 @@ int dexZipOpenArchive(const char* fileName, ZipArchive* pArchive)
memset(pArchive, 0, sizeof(ZipArchive));
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
fd = open(fileName, O_RDONLY | O_BINARY, 0);
if (fd < 0) {
err = errno ? errno : -1;