From c3540a96eca911763f9d500e0de78c2c79638c06 Mon Sep 17 00:00:00 2001 From: maxwen Date: Sun, 25 Oct 2015 22:22:06 +0100 Subject: Revert :Force sync files written by minzip forward port from 5.x https://gerrit.omnirom.org/#/c/12524/ Change-Id: I303662cf28278bd9dd3799b3d0b5a07f96169416 --- minzip/Zip.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/minzip/Zip.c b/minzip/Zip.c index c6272509f..1f035add5 100644 --- a/minzip/Zip.c +++ b/minzip/Zip.c @@ -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; -- cgit v1.2.3