aboutsummaryrefslogtreecommitdiff
path: root/bfd/nlm32-ppc.c
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/nlm32-ppc.c
parent6d4f771502a396883f5e201165512effd6c808b6 (diff)
downloadgdb-4002f18a05ecf53961c0e3b25a6d835576239fab.zip
gdb-4002f18a05ecf53961c0e3b25a6d835576239fab.tar.gz
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/nlm32-ppc.c')
-rw-r--r--bfd/nlm32-ppc.c30
1 files changed, 6 insertions, 24 deletions
diff --git a/bfd/nlm32-ppc.c b/bfd/nlm32-ppc.c
index 77c32a2..c46f94b 100644
--- a/bfd/nlm32-ppc.c
+++ b/bfd/nlm32-ppc.c
@@ -454,10 +454,7 @@ nlm_powerpc_read_reloc (abfd, sym, secp, rel)
/* Read the reloc from the file. */
if (bfd_read (&ext, sizeof ext, 1, abfd) != sizeof ext)
- {
- bfd_set_error (bfd_error_system_call);
- return false;
- }
+ return false;
/* Swap in the fields. */
l_vaddr = bfd_h_get_32 (abfd, ext.l_vaddr);
@@ -556,10 +553,7 @@ nlm_powerpc_read_import (abfd, sym)
if (bfd_read ((PTR) &symlength, sizeof (symlength), 1, abfd)
!= sizeof (symlength))
- {
- bfd_set_error (bfd_error_system_call);
- return (false);
- }
+ return (false);
sym -> symbol.the_bfd = abfd;
name = bfd_alloc (abfd, symlength + 1);
if (name == NULL)
@@ -568,20 +562,14 @@ nlm_powerpc_read_import (abfd, sym)
return false;
}
if (bfd_read (name, symlength, 1, abfd) != symlength)
- {
- bfd_set_error (bfd_error_system_call);
- return (false);
- }
+ return (false);
name[symlength] = '\0';
sym -> symbol.name = name;
sym -> symbol.flags = 0;
sym -> symbol.value = 0;
sym -> symbol.section = &bfd_und_section;
if (bfd_read ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp))
- {
- bfd_set_error (bfd_error_system_call);
- return (false);
- }
+ return (false);
rcount = bfd_h_get_32 (abfd, temp);
nlm_relocs = ((struct nlm_relent *)
bfd_alloc (abfd, rcount * sizeof (struct nlm_relent)));
@@ -740,17 +728,11 @@ nlm_powerpc_write_external (abfd, count, sym, relocs)
len = strlen (sym->name);
if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof(bfd_byte))
|| bfd_write (sym->name, len, 1, abfd) != len)
- {
- bfd_set_error (bfd_error_system_call);
- return false;
- }
+ return false;
bfd_put_32 (abfd, count, temp);
if (bfd_write (temp, sizeof(temp), 1, abfd) != sizeof (temp))
- {
- bfd_set_error (bfd_error_system_call);
- return false;
- }
+ return false;
for (i = 0; i < count; i++)
{