summaryrefslogtreecommitdiffstats
path: root/updater/blockimg.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-09-01 20:01:09 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-09-01 20:01:09 +0200
commit28f6c43db54159c218dd2ca27dbb775305b4011c (patch)
treece38d93bffc34e9304165aa198b24573870c2074 /updater/blockimg.cpp
parentMerge "minadbd: rename adb_server_main to minadbd_main." am: 818394869d am: aad4cef0f3 (diff)
parentMerge "Check an edge case when read(2) returns 0" am: 3202b8faf4 (diff)
downloadandroid_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.gz
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.bz2
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.lz
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.xz
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.tar.zst
android_bootable_recovery-28f6c43db54159c218dd2ca27dbb775305b4011c.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;
}