]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/cisco-core.c
Made sure that every call to bfd_read, bfd_write, and bfd_seek
[thirdparty/binutils-gdb.git] / bfd / cisco-core.c
index 2a916bfe1e98233ef88dcf02088b981cb8c19248..5a94d5107b17693de41fb51b7b0ed7780d1aff26 100644 (file)
@@ -67,8 +67,8 @@ cisco_core_file_p (abfd)
   nread = bfd_read (buf, 1, 4, abfd);
   if (nread != 4)
     {
-      /* Maybe the file is too small (FIXME: what about other errors).  */
-      bfd_set_error (bfd_error_wrong_format);
+      if (bfd_get_error () != bfd_error_system_call)
+       bfd_set_error (bfd_error_wrong_format);
       return NULL;
     }
   crashinfo_offset = bfd_get_32 (abfd, buf);
@@ -79,8 +79,8 @@ cisco_core_file_p (abfd)
   nread = bfd_read (&crashinfo, 1, sizeof (crashinfo), abfd);
   if (nread != sizeof (crashinfo))
     {
-      /* Maybe the file is too small (FIXME: what about other errors).  */
-      bfd_set_error (bfd_error_wrong_format);
+      if (bfd_get_error () != bfd_error_system_call)
+       bfd_set_error (bfd_error_wrong_format);
       return NULL;
     }