aboutsummaryrefslogtreecommitdiff
path: root/bfd/coff-rs6000.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1994-04-04 22:49:04 +0000
committerIan Lance Taylor <ian@airs.com>1994-04-04 22:49:04 +0000
commit4002f18a05ecf53961c0e3b25a6d835576239fab (patch)
treef1418405276000a7a2eec3c0c95722c53bb9ca96 /bfd/coff-rs6000.c
parent6d4f771502a396883f5e201165512effd6c808b6 (diff)
downloadgdb-4002f18a05ecf53961c0e3b25a6d835576239fab.zip
gdb-4002f18a05ecf53961c0e3b25a6d835576239fab.tar.gz
gdb-4002f18a05ecf53961c0e3b25a6d835576239fab.tar.bz2
Made sure that every call to bfd_read, bfd_write, and bfd_seek
checks the return value and handled bfd_error correctly. These changes are not itemised.
Diffstat (limited to 'bfd/coff-rs6000.c')
-rw-r--r--bfd/coff-rs6000.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c
index e861043..b24c015 100644
--- a/bfd/coff-rs6000.c
+++ b/bfd/coff-rs6000.c
@@ -527,14 +527,16 @@ rs6000coff_snarf_ar_hdr (abfd)
size = sizeof (h.hdr);
if (bfd_read(&h.hdr, 1, size, abfd) != size) {
- bfd_set_error (bfd_error_no_more_archived_files);
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_no_more_archived_files);
return NULL;
}
size = atoi(h.hdr.ar_namlen); /* ar_name[] length */
size += size & 1;
if (bfd_read(&h.hdr._ar_name.ar_name[2], 1, size, abfd) != size) {
- bfd_set_error (bfd_error_no_more_archived_files);
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_no_more_archived_files);
return NULL;
}
@@ -634,7 +636,8 @@ rs6000coff_archive_p (abfd)
register struct artdata *art;
if (bfd_read (&hdr, sizeof (hdr), 1, abfd) != sizeof (hdr)) {
- bfd_set_error (bfd_error_wrong_format);
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
return 0;
}