summaryrefslogtreecommitdiffstats
path: root/fastboot
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-06-02 21:37:05 -0700
committerElliott Hughes <enh@google.com>2015-06-04 13:26:57 -0700
commit966339b2d60c0721a6ec9ebd541e291b1b4c34df (patch)
treee1bd873ea0158472d689b7529fb04cfc475be61d /fastboot
parentc688c23286f40309e5af1f7f91d6d6f1de3f7749 (diff)
downloadsystem_core-966339b2d60c0721a6ec9ebd541e291b1b4c34df.zip
system_core-966339b2d60c0721a6ec9ebd541e291b1b4c34df.tar.gz
system_core-966339b2d60c0721a6ec9ebd541e291b1b4c34df.tar.bz2
Don't say "update package missing" unless we mean it.
unzip_to_file reports failures itself these days, so there's it's unhelpful of the caller to just guess what might have gone wrong. Bug: http://b/21558406 Change-Id: I1e3d06c6cf902b8c6ef333dc60fd8f49680a493b (cherry picked from commit acdbe92c60e662a4913f1fca09c2b8913791376c)
Diffstat (limited to 'fastboot')
-rw-r--r--fastboot/fastboot.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index e587590..6724d05 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -724,13 +724,14 @@ void do_update(usb_handle *usb, const char *filename, int erase_first)
setup_requirements(reinterpret_cast<char*>(data), sz);
- for (size_t i = 0; i < ARRAY_SIZE(images); i++) {
+ for (size_t i = 0; i < ARRAY_SIZE(images); ++i) {
int fd = unzip_to_file(zip, images[i].img_name);
- if (fd < 0) {
- if (images[i].is_optional)
+ if (fd == -1) {
+ if (images[i].is_optional) {
continue;
+ }
CloseArchive(zip);
- die("update package missing %s", images[i].img_name);
+ exit(1); // unzip_to_file already explained why.
}
fastboot_buffer buf;
int rc = load_buf_fd(usb, fd, &buf);