Merge "Revert :Force sync files written by minzip" into android-6.0

This commit is contained in:
Dees Troy
2015-11-05 19:45:31 +01:00
committed by Gerrit Code Review

View File

@@ -977,8 +977,7 @@ bool mzExtractRecursive(const ZipArchive *pArchive,
setfscreatecon(secontext);
}
int fd = open(targetFile, O_CREAT|O_WRONLY|O_TRUNC|O_SYNC,
UNZIP_FILEMODE);
int fd = creat(targetFile, UNZIP_FILEMODE);
if (secontext) {
freecon(secontext);
@@ -993,12 +992,7 @@ bool mzExtractRecursive(const ZipArchive *pArchive,
}
bool ok = mzExtractZipEntryToFile(pArchive, pEntry, fd);
if (ok) {
ok = (fsync(fd) == 0);
}
if (close(fd) != 0) {
ok = false;
}
close(fd);
if (!ok) {
LOGE("Error extracting \"%s\"\n", targetFile);
ok = false;