summaryrefslogtreecommitdiffstats
path: root/minzip
diff options
context:
space:
mode:
authorAndrew Dodd <atd7@cornell.edu>2015-03-19 16:28:29 +0100
committerGerrit Code Review <gerrit2@gerrit>2015-03-19 16:28:30 +0100
commit89d90e2b9ae24203f9c1b034fe119154be0205f1 (patch)
treebf400bca1ccfe2c64808bfa33e836c7d7805e39e /minzip
parentgui: keyboard: introduce struct Layout and simplify caps handling (diff)
parentRevert "Force sync files written by minzip." (diff)
downloadandroid_bootable_recovery-89d90e2b9ae24203f9c1b034fe119154be0205f1.tar
android_bootable_recovery-89d90e2b9ae24203f9c1b034fe119154be0205f1.tar.gz
android_bootable_recovery-89d90e2b9ae24203f9c1b034fe119154be0205f1.tar.bz2
android_bootable_recovery-89d90e2b9ae24203f9c1b034fe119154be0205f1.tar.lz
android_bootable_recovery-89d90e2b9ae24203f9c1b034fe119154be0205f1.tar.xz
android_bootable_recovery-89d90e2b9ae24203f9c1b034fe119154be0205f1.tar.zst
android_bootable_recovery-89d90e2b9ae24203f9c1b034fe119154be0205f1.zip
Diffstat (limited to 'minzip')
-rw-r--r--minzip/Zip.c10
1 files 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;