Made sure that every call to bfd_read, bfd_write, and bfd_seek
[deliverable/binutils-gdb.git] / bfd / ecoff.c
index 03975e6128cbc200324b0e113d08b254af96bdbf..fe786abaaef3872eed10e8de271e63a05c1774a4 100644 (file)
@@ -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;
     }
 
This page took 0.024254 seconds and 4 git commands to generate.