summaryrefslogtreecommitdiffstats
path: root/updater/blockimg.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-09-01 03:06:33 +0200
committerTianjie Xu <xunchang@google.com>2016-09-01 04:11:41 +0200
commit71e182bc3879a53f04a50de9d25c333163cb7c76 (patch)
tree4f116fad73bb81476238deb9a70313f54cd68246 /updater/blockimg.cpp
parentMerge "minadbd: rename adb_server_main to minadbd_main." (diff)
downloadandroid_bootable_recovery-71e182bc3879a53f04a50de9d25c333163cb7c76.tar
android_bootable_recovery-71e182bc3879a53f04a50de9d25c333163cb7c76.tar.gz
android_bootable_recovery-71e182bc3879a53f04a50de9d25c333163cb7c76.tar.bz2
android_bootable_recovery-71e182bc3879a53f04a50de9d25c333163cb7c76.tar.lz
android_bootable_recovery-71e182bc3879a53f04a50de9d25c333163cb7c76.tar.xz
android_bootable_recovery-71e182bc3879a53f04a50de9d25c333163cb7c76.tar.zst
android_bootable_recovery-71e182bc3879a53f04a50de9d25c333163cb7c76.zip
Diffstat (limited to 'updater/blockimg.cpp')
-rw-r--r--updater/blockimg.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/updater/blockimg.cpp b/updater/blockimg.cpp
index f00bc4bff..0caa1acbd 100644
--- a/updater/blockimg.cpp
+++ b/updater/blockimg.cpp
@@ -151,6 +151,10 @@ static int read_all(int fd, uint8_t* data, size_t size) {
failure_type = kFreadFailure;
fprintf(stderr, "read failed: %s\n", strerror(errno));
return -1;
+ } else if (r == 0) {
+ failure_type = kFreadFailure;
+ fprintf(stderr, "read reached unexpected EOF.\n");
+ return -1;
}
so_far += r;
}