diff options
| author | Tao Bao <tbao@google.com> | 2016-11-15 10:08:07 -0800 |
|---|---|---|
| committer | Tao Bao <tbao@google.com> | 2016-11-15 10:19:04 -0800 |
| commit | a456c2134882c7cede4d0f617a20ce0f8f8f3358 (patch) | |
| tree | 79aa2cd87055714284e2cce447210695c128e060 /trusty/coverage/coverage.cpp | |
| parent | 557359863c0d1fcda9a85e3b7fb275cb12a3eb70 (diff) | |
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
Diffstat (limited to 'trusty/coverage/coverage.cpp')
0 files changed, 0 insertions, 0 deletions
