summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaxwen <max.weninger@gmail.com>2015-10-25 22:22:06 +0100
committermaxwen <max.weninger@gmail.com>2015-10-25 22:22:10 +0100
commitc3540a96eca911763f9d500e0de78c2c79638c06 (patch)
tree301c0d94e3c8487133931665e35d20453398d905
parentAdd nulls during reading of settings and info files (diff)
downloadandroid_bootable_recovery-c3540a96eca911763f9d500e0de78c2c79638c06.tar
android_bootable_recovery-c3540a96eca911763f9d500e0de78c2c79638c06.tar.gz
android_bootable_recovery-c3540a96eca911763f9d500e0de78c2c79638c06.tar.bz2
android_bootable_recovery-c3540a96eca911763f9d500e0de78c2c79638c06.tar.lz
android_bootable_recovery-c3540a96eca911763f9d500e0de78c2c79638c06.tar.xz
android_bootable_recovery-c3540a96eca911763f9d500e0de78c2c79638c06.tar.zst
android_bootable_recovery-c3540a96eca911763f9d500e0de78c2c79638c06.zip
-rw-r--r--minzip/Zip.c10
1 files 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;