summaryrefslogtreecommitdiffstats
path: root/minzip/Zip.c
diff options
context:
space:
mode:
authorAndrew Dodd <atd7@cornell.edu>2015-03-11 23:07:48 +0100
committerDees Troy <dees_troy@teamw.in>2015-03-13 19:49:29 +0100
commitde72a98328213a5929723913086b20023335d07b (patch)
treece248439f15e40d8ce2b5414d669d74f0b9ed942 /minzip/Zip.c
parentMerge tag 'android-5.1.0_r1' of https://android.googlesource.com/platform/bootable/recovery into aosp (diff)
downloadandroid_bootable_recovery-de72a98328213a5929723913086b20023335d07b.tar
android_bootable_recovery-de72a98328213a5929723913086b20023335d07b.tar.gz
android_bootable_recovery-de72a98328213a5929723913086b20023335d07b.tar.bz2
android_bootable_recovery-de72a98328213a5929723913086b20023335d07b.tar.lz
android_bootable_recovery-de72a98328213a5929723913086b20023335d07b.tar.xz
android_bootable_recovery-de72a98328213a5929723913086b20023335d07b.tar.zst
android_bootable_recovery-de72a98328213a5929723913086b20023335d07b.zip
Diffstat (limited to 'minzip/Zip.c')
-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;