diff options
author | David Anderson <dvander@google.com> | 2018-12-04 17:05:47 -0800 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2018-12-04 17:12:58 -0800 |
commit | 0047580398881ed218166a28088df3cb1931d33c (patch) | |
tree | bda5528a77747174280280b393314168c8f505cc /fastboot/fastboot.cpp | |
parent | 5ae47e10c82be1889a8d86f28f37302aaefcd306 (diff) | |
download | system_core-0047580398881ed218166a28088df3cb1931d33c.tar.gz system_core-0047580398881ed218166a28088df3cb1931d33c.tar.bz2 system_core-0047580398881ed218166a28088df3cb1931d33c.zip |
fastboot: Check if super_empty.img exists before reading it.
On non-DAP devices, fastboot flash <partition> will spam error messages
about not being able to read super_empty.img. We should check that
super_empty.img exists before trying to read it.
Bug: 120429424
Test: fastboot flash system on non-DAP device
Change-Id: I6c4eec19cb3ef8d24595a75e072e1d75baaa8cdd
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r-- | fastboot/fastboot.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index fee08577c..b717aef72 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -1541,7 +1541,7 @@ static bool should_flash_in_userspace(const std::string& partition_name) { return false; } auto path = find_item_given_name("super_empty.img"); - if (path.empty()) { + if (path.empty() || access(path.c_str(), R_OK)) { return false; } auto metadata = android::fs_mgr::ReadFromImageFile(path); |