aboutsummaryrefslogtreecommitdiff
path: root/bfd/ecoff.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/ecoff.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/ecoff.c')
-rw-r--r--bfd/ecoff.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/bfd/ecoff.c b/bfd/ecoff.c
index 03975e6..fe786ab 100644
--- a/bfd/ecoff.c
+++ b/bfd/ecoff.c
@@ -3025,7 +3025,8 @@ ecoff_slurp_armap (abfd)
if (i != 16)
return false;
- bfd_seek (abfd, (file_ptr) -16, SEEK_CUR);
+ if (bfd_seek (abfd, (file_ptr) -16, SEEK_CUR) != 0)
+ return false;
/* Irix 4.0.5F apparently can use either an ECOFF armap or a
standard COFF armap. We could move the ECOFF armap stuff into
@@ -3078,7 +3079,8 @@ ecoff_slurp_armap (abfd)
if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size)
{
- bfd_set_error (bfd_error_malformed_archive);
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_malformed_archive);
bfd_release (abfd, (PTR) raw_armap);
return false;
}
@@ -3349,7 +3351,8 @@ ecoff_archive_p (abfd)
if (bfd_read ((PTR) armag, 1, SARMAG, abfd) != SARMAG
|| strncmp (armag, ARMAG, SARMAG) != 0)
{
- bfd_set_error (bfd_error_wrong_format);
+ if (bfd_get_error () != bfd_error_system_call)
+ bfd_set_error (bfd_error_wrong_format);
return (bfd_target *) NULL;
}