summaryrefslogtreecommitdiffstats
path: root/include/utils
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2010-10-01 18:28:28 -0700
committerKenny Root <kroot@google.com>2010-10-01 18:30:59 -0700
commit6cb241f9024c6923715cf4e9eeaf803a7d258750 (patch)
tree455507c53e8e0d20dee11d1888cebd67ff947523 /include/utils
parent306137d97f40a4f807c54a75210343c9262360d1 (diff)
downloadframeworks_base-6cb241f9024c6923715cf4e9eeaf803a7d258750.zip
frameworks_base-6cb241f9024c6923715cf4e9eeaf803a7d258750.tar.gz
frameworks_base-6cb241f9024c6923715cf4e9eeaf803a7d258750.tar.bz2
ZipFileRO: moar logging and wrap close
There is apparently still a race upon reading the entry Local File Header that can't be tracked down, so move the LFH check inside the mutex-protected block so we can call lseek again to see where we are when we log an error. Also, close() can fail so use TEMP_FAILURE_RETRY on it so we don't unwittingly leak file descriptors when Mean Mr. EINTR comes a-knocking. Change-Id: I753abad0bd882fe28f7281c406fa76f64393ef4c
Diffstat (limited to 'include/utils')
-rw-r--r--include/utils/ZipFileRO.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/include/utils/ZipFileRO.h b/include/utils/ZipFileRO.h
index 9668bde..e1ff780 100644
--- a/include/utils/ZipFileRO.h
+++ b/include/utils/ZipFileRO.h
@@ -64,15 +64,8 @@ public:
mNumEntries(-1), mDirectoryOffset(-1),
mHashTableSize(-1), mHashTable(NULL)
{}
- ~ZipFileRO() {
- free(mHashTable);
- if (mDirectoryMap)
- mDirectoryMap->release();
- if (mFd >= 0)
- close(mFd);
- if (mFileName)
- free(mFileName);
- }
+
+ ~ZipFileRO();
/*
* Open an archive.