From 4002f18a05ecf53961c0e3b25a6d835576239fab Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 4 Apr 1994 22:49:04 +0000 Subject: 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. --- bfd/ecoff.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bfd/ecoff.c') 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; } -- cgit v1.1