platform_system_core/libziparchive
Tao Bao a456c21348 ziparchive: Allow ExtractEntryToFile() to work with block device.
FileWriter::Create() calls ftruncate(2) to truncate the destination
file, which doesn't work with FD that references a block device. It
leads to kIoError when calling ExtractEntryToFile() to extract an entry
to block device FD.

As a result, it fails the package_extract_file() command in OTA updates
(e.g. 'package_extract_file("boot.img",
"/dev/block/platform/soc.0/f9824900.sdhci/by-name/boot")').

This CL skips the call to ftruncate(2) if FD references a block device.

Bug: 32903624
Test: ziparchive-tests works.
Test: Build an OTA updater (m updater) and call package_extract_file().

Change-Id: Ia81116f1a8d7cab802396bdc32c6096b4cb56a3c
2016-11-15 10:19:04 -08:00
..
testdata Add functions in recovery/minzip to libziparchive 2016-10-15 23:16:34 -07:00
Android.bp Convert libziparchive from Android.mk to Android.bp 2016-07-12 21:01:08 -07:00
entry_name_utils-inl.h Reject zip archives whose entry names are not valid UTF-8. 2014-12-08 12:25:05 +00:00
entry_name_utils_test.cc Reject zip archives whose entry names are not valid UTF-8. 2014-12-08 12:25:05 +00:00
zip_archive.cc ziparchive: Allow ExtractEntryToFile() to work with block device. 2016-11-15 10:19:04 -08:00
zip_archive_common.h Track rename of base/ to android-base/. 2015-12-04 22:00:26 -08:00
zip_archive_private.h Add functions in recovery/minzip to libziparchive 2016-10-15 23:16:34 -07:00
zip_archive_stream_entry.cc Add functions in recovery/minzip to libziparchive 2016-10-15 23:16:34 -07:00
zip_archive_test.cc Add functions in recovery/minzip to libziparchive 2016-10-15 23:16:34 -07:00
zip_writer.cc Fix warnings in libziparchive 2016-09-20 09:23:47 -07:00
zip_writer_test.cc libziparchive: port unit tests to darwin and windows. 2016-03-07 11:21:24 -08:00