This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
redundant bfd_set_error calls
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: binutils at sources dot redhat dot com
- Date: Mon, 17 Jun 2002 12:03:13 +0930
- Subject: redundant bfd_set_error calls
A small tidyup. bfd_find_target calls bfd_set_error itself.
bfd/ChangeLog
* opncls.c (bfd_openr): Remove redundant bfd_set_error.
(bfd_fdopenr): Likewise.
(bfd_openstreamr): Likewise.
(bfd_openw): Likewise.
Index: bfd/opncls.c
===================================================================
RCS file: /cvs/src/src/bfd/opncls.c,v
retrieving revision 1.9
diff -u -p -r1.9 opncls.c
--- bfd/opncls.c 4 May 2002 01:31:08 -0000 1.9
+++ bfd/opncls.c 17 Jun 2002 01:33:25 -0000
@@ -152,7 +152,6 @@ bfd_openr (filename, target)
target_vec = bfd_find_target (target, nbfd);
if (target_vec == NULL)
{
- bfd_set_error (bfd_error_invalid_target);
_bfd_delete_bfd (nbfd);
return NULL;
}
@@ -220,7 +219,8 @@ bfd_fdopenr (filename, target, fd)
#else
fdflags = fcntl (fd, F_GETFL, NULL);
#endif
- if (fdflags == -1) return NULL;
+ if (fdflags == -1)
+ return NULL;
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)
@@ -229,7 +229,6 @@ bfd_fdopenr (filename, target, fd)
target_vec = bfd_find_target (target, nbfd);
if (target_vec == NULL)
{
- bfd_set_error (bfd_error_invalid_target);
_bfd_delete_bfd (nbfd);
return NULL;
}
@@ -308,7 +307,6 @@ bfd_openstreamr (filename, target, strea
target_vec = bfd_find_target (target, nbfd);
if (target_vec == NULL)
{
- bfd_set_error (bfd_error_invalid_target);
_bfd_delete_bfd (nbfd);
return NULL;
}
@@ -353,8 +351,6 @@ bfd_openw (filename, target)
{
bfd *nbfd;
const bfd_target *target_vec;
-
- bfd_set_error (bfd_error_system_call);
/* nbfd has to point to head of malloc'ed block so that bfd_close may
reclaim it correctly. */
--
Alan Modra
IBM OzLabs - Linux Technology Centre