Made sure that every call to bfd_read, bfd_write, and bfd_seek
[deliverable/binutils-gdb.git] / bfd / i386lynx.c
index e643dad795a3287b3d69dbc557c9ee65b8a0f899..784a6f27ac0c86d7bda8e43e2ffa2199380dd4d0 100644 (file)
@@ -50,22 +50,32 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
                           obj_reloc_entry_size (abfd));                      \
        NAME(aout,swap_exec_header_out) (abfd, execp, &exec_bytes);           \
                                                                              \
-       bfd_seek (abfd, (file_ptr) 0, SEEK_SET);                              \
-       bfd_write ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd);              \
+       if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) != 0) return false;       \
+       if (bfd_write ((PTR) &exec_bytes, 1, EXEC_BYTES_SIZE, abfd)           \
+           != EXEC_BYTES_SIZE)                                               \
+         return false;                                                       \
        /* Now write out reloc info, followed by syms and strings */          \
                                                                              \
        if (bfd_get_symcount (abfd) != 0)                                     \
            {                                                                 \
-             bfd_seek (abfd, (file_ptr)(N_SYMOFF(*execp)), SEEK_SET);        \
+             if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*execp)), SEEK_SET)     \
+                 != 0)                                                       \
+               return false;                                                 \
                                                                              \
              if (! NAME(aout,write_syms)(abfd)) return false;                \
                                                                              \
-             bfd_seek (abfd, (file_ptr)(N_TRELOFF(*execp)), SEEK_SET);       \
+             if (bfd_seek (abfd, (file_ptr)(N_TRELOFF(*execp)), SEEK_SET)    \
+                 != 0)                                                       \
+               return false;                                                 \
                                                                              \
-             if (!NAME(lynx,squirt_out_relocs) (abfd, obj_textsec (abfd))) return false; \
-             bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET);       \
+             if (!NAME(lynx,squirt_out_relocs) (abfd, obj_textsec (abfd)))   \
+               return false;                                                 \
+             if (bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET)    \
+                 != 0)                                                       \
+               return 0;                                                     \
                                                                              \
-             if (!NAME(lynx,squirt_out_relocs)(abfd, obj_datasec (abfd))) return false; \
+             if (!NAME(lynx,squirt_out_relocs)(abfd, obj_datasec (abfd)))    \
+               return false;                                                 \
            }                                                                 \
       }
 #endif
This page took 0.023062 seconds and 4 git commands to generate.