aboutsummaryrefslogtreecommitdiff
path: root/bfd/cache.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2008-02-11 13:52:02 +0000
committerDaniel Jacobowitz <drow@false.org>2008-02-11 13:52:02 +0000
commit662ed161c7acca33059d5eef0d5751daab8d58a1 (patch)
tree714da0668a5b49f822d65b8bf2197a569bd209bd /bfd/cache.c
parentaf1be95ea412815d8c58880189470b4c3dc6c0aa (diff)
downloadgdb-662ed161c7acca33059d5eef0d5751daab8d58a1.zip
gdb-662ed161c7acca33059d5eef0d5751daab8d58a1.tar.gz
gdb-662ed161c7acca33059d5eef0d5751daab8d58a1.tar.bz2
* cache.c (cache_bread): Set bfd_error_file_truncated if EOF
was reached. * srec.c (srec_scan): Calculate the checksum. Complain on mismatch.
Diffstat (limited to 'bfd/cache.c')
-rw-r--r--bfd/cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/cache.c b/bfd/cache.c
index 039c1a9..064cebe 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -309,6 +309,10 @@ cache_bread (struct bfd *abfd, void *buf, file_ptr nbytes)
return -1;
}
#endif
+ if (nread < nbytes)
+ /* This may or may not be an error, but in case the calling code
+ bails out because of it, set the right error code. */
+ bfd_set_error (bfd_error_file_truncated);
return nread;
}