summaryrefslogtreecommitdiffstats
path: root/minzipold/Zip.c
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-11-21 20:54:27 +0100
committerEthan Yonker <dees_troy@teamw.in>2014-12-02 17:34:15 +0100
commit75bf041a8ad75f8fc9bba69e937e12b129338a4c (patch)
tree9a3202b8c06e075e1749a44948a3a3f184edf95e /minzipold/Zip.c
parentTWRP MTP: make sure inotify_fd is set (diff)
downloadandroid_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.gz
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.bz2
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.lz
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.xz
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.tar.zst
android_bootable_recovery-75bf041a8ad75f8fc9bba69e937e12b129338a4c.zip
Diffstat (limited to 'minzipold/Zip.c')
-rw-r--r--minzipold/Zip.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/minzipold/Zip.c b/minzipold/Zip.c
index 54d5d55a3..439e5d9cd 100644
--- a/minzipold/Zip.c
+++ b/minzipold/Zip.c
@@ -985,6 +985,7 @@ bool mzExtractRecursive(const ZipArchive *pArchive,
unsigned int i;
bool seenMatch = false;
int ok = true;
+ int extractCount = 0;
for (i = 0; i < pArchive->numEntries; i++) {
ZipEntry *pEntry = pArchive->pEntries + i;
if (pEntry->fileNameLen < zipDirLen) {
@@ -1115,23 +1116,19 @@ bool mzExtractRecursive(const ZipArchive *pArchive,
* Open the target for writing.
*/
-#ifdef HAVE_SELINUX
char *secontext = NULL;
if (sehnd) {
selabel_lookup(sehnd, &secontext, targetFile, UNZIP_FILEMODE);
setfscreatecon(secontext);
}
-#endif
int fd = creat(targetFile, UNZIP_FILEMODE);
-#ifdef HAVE_SELINUX
if (secontext) {
freecon(secontext);
setfscreatecon(NULL);
}
-#endif
if (fd < 0) {
LOGE("Can't create target file \"%s\": %s\n",
@@ -1154,13 +1151,16 @@ bool mzExtractRecursive(const ZipArchive *pArchive,
break;
}
- LOGD("Extracted file \"%s\"\n", targetFile);
+ LOGV("Extracted file \"%s\"\n", targetFile);
+ ++extractCount;
}
}
if (callback != NULL) callback(targetFile, cookie);
}
+ LOGD("Extracted %d file(s)\n", extractCount);
+
free(helper.buf);
free(zpath);