Open zips using _wopen on windows.

Allows for opening zip files usng paths longer than 260 characters and
with unicode characters on Windows.

Bug: 113110184
Test: manual and libziparchive_tests
Change-Id: I9ce96ac2f1b1e448ae2a2f69c1d4cb3395ea79ee
This commit is contained in:
Ryan Mitchell 2018-08-25 14:06:29 -07:00
parent 53ba407a89
commit c77f9d380f
1 changed files with 2 additions and 1 deletions

View File

@ -41,6 +41,7 @@
#include <android-base/logging.h>
#include <android-base/macros.h> // TEMP_FAILURE_RETRY may or may not be in unistd
#include <android-base/memory.h>
#include <android-base/utf8.h>
#include <log/log.h>
#include <utils/Compat.h>
#include <utils/FileMap.h>
@ -471,7 +472,7 @@ int32_t OpenArchiveFd(int fd, const char* debug_file_name, ZipArchiveHandle* han
}
int32_t OpenArchive(const char* fileName, ZipArchiveHandle* handle) {
const int fd = open(fileName, O_RDONLY | O_BINARY, 0);
const int fd = ::android::base::utf8::open(fileName, O_RDONLY | O_BINARY, 0);
ZipArchive* archive = new ZipArchive(fd, true);
*handle = archive;