aboutsummaryrefslogtreecommitdiffstats
path: root/minzip/Zip.h
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2009-05-05 17:50:21 -0700
committerDoug Zongker <dougz@android.com>2009-05-06 08:40:28 -0700
commit683c4628039a8cb6dad1a086fae23a7d71438414 (patch)
treeaacd5abd9b128d786f651b2dfb2a5eb5400c5e43 /minzip/Zip.h
parent596271fa71d79e3eec03c7cf6ac76cb026dd8578 (diff)
downloadbootable_recovery-683c4628039a8cb6dad1a086fae23a7d71438414.zip
bootable_recovery-683c4628039a8cb6dad1a086fae23a7d71438414.tar.gz
bootable_recovery-683c4628039a8cb6dad1a086fae23a7d71438414.tar.bz2
align data passed to write() on 32k boundaries
In donut, OTA installation often encounters the write() system call doing short writes -- which is legal but unexpected -- or failing with ENOSPC when plenty of space is available. Passing aligned memory buffers to write() appears to prevent (or at least reduce the frequency) of these problems. b/1833052 has been filed to look at the underlying problem, but this change aligns buffers we use with write() so we can OTA for now (or see if this problem still occurs).
Diffstat (limited to 'minzip/Zip.h')
-rw-r--r--minzip/Zip.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/minzip/Zip.h b/minzip/Zip.h
index 1c1df2f..57c0abd 100644
--- a/minzip/Zip.h
+++ b/minzip/Zip.h
@@ -56,6 +56,14 @@ typedef struct {
} UnterminatedString;
/*
+ * The information we pass down to writeProcessFunction.
+ */
+typedef struct {
+ int fd;
+ unsigned char* aligned_buffer;
+} WriteInfo;
+
+/*
* Open a Zip archive.
*
* On success, returns 0 and populates "pArchive". Returns nonzero errno
@@ -166,7 +174,7 @@ bool mzIsZipEntryIntact(const ZipArchive *pArchive, const ZipEntry *pEntry);
* Inflate and write an entry to a file.
*/
bool mzExtractZipEntryToFile(const ZipArchive *pArchive,
- const ZipEntry *pEntry, int fd);
+ const ZipEntry *pEntry, WriteInfo *wi);
/*
* Inflate all entries under zipDir to the directory specified by