aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/cache.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8c922aa..96f85f7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
2014-07-15 Alan Modra <amodra@gmail.com>
+ * cache.c (cache_bread_1): Don't return -1 when fread returns
+ a positive value.
+
+2014-07-15 Alan Modra <amodra@gmail.com>
+
* elflink.c (elf_merge_st_other): Update comments. Simplify
visibility handling. Make isym const. Move code modifying
isym->st_other for --exclude-libs to..
diff --git a/bfd/cache.c b/bfd/cache.c
index 27fe70a..ffda004 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -310,7 +310,7 @@ cache_bread_1 (struct bfd *abfd, void *buf, file_ptr nbytes)
if (nread == (file_ptr)-1)
{
bfd_set_error (bfd_error_system_call);
- return -1;
+ return nread;
}
#else
nread = fread (buf, 1, nbytes, f);
@@ -320,7 +320,7 @@ cache_bread_1 (struct bfd *abfd, void *buf, file_ptr nbytes)
if (nread < nbytes && ferror (f))
{
bfd_set_error (bfd_error_system_call);
- return -1;
+ return nread;
}
#endif
if (nread < nbytes)