aboutsummaryrefslogtreecommitdiff
path: root/bfd/libaout.h
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/libaout.h
parent6d4f771502a396883f5e201165512effd6c808b6 (diff)
downloadfsf-binutils-gdb-4002f18a05ecf53961c0e3b25a6d835576239fab.zip
fsf-binutils-gdb-4002f18a05ecf53961c0e3b25a6d835576239fab.tar.gz
fsf-binutils-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/libaout.h')
-rw-r--r--bfd/libaout.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/bfd/libaout.h b/bfd/libaout.h
index 0b22dee..9a3cecc 100644
--- a/bfd/libaout.h
+++ b/bfd/libaout.h
@@ -434,23 +434,33 @@ aout_stab_name PARAMS ((int code));
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_outsymbols (abfd) != (asymbol **) NULL \
&& 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(aout,squirt_out_relocs) (abfd, obj_textsec (abfd))) return false; \
- bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET); \
+ if (!NAME(aout,squirt_out_relocs) (abfd, obj_textsec (abfd))) \
+ return false; \
+ if (bfd_seek (abfd, (file_ptr)(N_DRELOFF(*execp)), SEEK_SET) \
+ != 0) \
+ return false; \
\
- if (!NAME(aout,squirt_out_relocs)(abfd, obj_datasec (abfd))) return false; \
+ if (!NAME(aout,squirt_out_relocs)(abfd, obj_datasec (abfd))) \
+ return false; \
} \
}
#endif