From de72a98328213a5929723913086b20023335d07b Mon Sep 17 00:00:00 2001 From: Andrew Dodd Date: Wed, 11 Mar 2015 18:07:48 -0400 Subject: Revert "Force sync files written by minzip." This has been causing significant performance degradation when flashing updates for the entirety of 5.0. I was originally hesitant to do this since we don't want unsynced files on an update, however - Our updater-script unmounts /system at the end of installation, which will force a sync. As a result the issue Google was trying to fix won't be present for our ZIPs. This reverts commit a6c142f2a579ea5e7cdfbc88e6a061c55029265a. Change-Id: I89b22e2677c4eda4d3e6338adc0046bf754d43b2 --- minzip/Zip.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/minzip/Zip.c b/minzip/Zip.c index 70aff00cd..5070104d3 100644 --- a/minzip/Zip.c +++ b/minzip/Zip.c @@ -1067,8 +1067,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); @@ -1083,12 +1082,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; -- cgit v1.2.3