From 372191f2b87d90acfb25db5c938ac96f861c2c04 Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Mon, 6 Jun 2011 10:50:57 -0700 Subject: Only use O_BINARY if it is defined (windows compatibility) Change-Id: Iaa3c0812ef4d90d46b4031be7f4faca84c7d7200 Signed-off-by: Bruce Beare --- libdex/CmdUtils.c | 3 +++ libdex/ZipArchive.c | 3 +++ 2 files changed, 6 insertions(+) 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; -- cgit v1.2.3