Skip to content

Commit

Permalink
Merge "Revert "Force sync files written by minzip."" into android-5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Entropy512 authored and Gerrit Code Review committed Mar 19, 2015
2 parents d86f49d + de72a98 commit 89d90e2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions minzip/Zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 89d90e2

Please sign in to comment.