diff options
author | Kenny Root <kroot@google.com> | 2010-09-07 19:41:00 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-09-07 19:41:00 -0700 |
commit | a009dde6f481464fe60e3fca5ead9fcfab03ddcf (patch) | |
tree | 7e7f58d3e332e99843e29d4b5fec97a4bfe16c00 /libs/utils | |
parent | 5c69544826258bf047fc72c871c18e4a5b24d873 (diff) | |
parent | 2a08e2a9f881d06a03e36367585137e05706f592 (diff) | |
download | frameworks_base-a009dde6f481464fe60e3fca5ead9fcfab03ddcf.zip frameworks_base-a009dde6f481464fe60e3fca5ead9fcfab03ddcf.tar.gz frameworks_base-a009dde6f481464fe60e3fca5ead9fcfab03ddcf.tar.bz2 |
am 2a08e2a9: am a19ef306: Revert "Free created FileMap when uncompressing files"
Merge commit '2a08e2a9f881d06a03e36367585137e05706f592'
* commit '2a08e2a9f881d06a03e36367585137e05706f592':
Revert "Free created FileMap when uncompressing files"
Diffstat (limited to 'libs/utils')
-rw-r--r-- | libs/utils/ZipFileRO.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/libs/utils/ZipFileRO.cpp b/libs/utils/ZipFileRO.cpp index a0e01c6..2d53136 100644 --- a/libs/utils/ZipFileRO.cpp +++ b/libs/utils/ZipFileRO.cpp @@ -636,7 +636,7 @@ bool ZipFileRO::uncompressEntry(ZipEntryRO entry, void* buffer) const memcpy(buffer, ptr, uncompLen); } else { if (!inflateBuffer(buffer, ptr, uncompLen, compLen)) - goto unmap; + goto bail; } if (compLen > kSequentialMin) @@ -644,8 +644,6 @@ bool ZipFileRO::uncompressEntry(ZipEntryRO entry, void* buffer) const result = true; -unmap: - file->release(); bail: return result; } @@ -669,7 +667,7 @@ bool ZipFileRO::uncompressEntry(ZipEntryRO entry, int fd) const getEntryInfo(entry, &method, &uncompLen, &compLen, &offset, NULL, NULL); - FileMap* file = createEntryFileMap(entry); + const FileMap* file = createEntryFileMap(entry); if (file == NULL) { goto bail; } @@ -680,23 +678,21 @@ bool ZipFileRO::uncompressEntry(ZipEntryRO entry, int fd) const ssize_t actual = write(fd, ptr, uncompLen); if (actual < 0) { LOGE("Write failed: %s\n", strerror(errno)); - goto unmap; + goto bail; } else if ((size_t) actual != uncompLen) { LOGE("Partial write during uncompress (%zd of %zd)\n", (size_t)actual, (size_t)uncompLen); - goto unmap; + goto bail; } else { LOGI("+++ successful write\n"); } } else { if (!inflateBuffer(fd, ptr, uncompLen, compLen)) - goto unmap; + goto bail; } result = true; -unmap: - file->release(); bail: return result; } |