summaryrefslogtreecommitdiff
path: root/bfd/opncls.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2005-06-08 03:16:48 +0000
committerAlan Modra <amodra@bigpond.net.au>2005-06-08 03:16:48 +0000
commit22e899a32602e789e1066fc677111d9a207cc0bb (patch)
treeea5cafd15ad0f3fc98100a1f7a739c6b0e9afe17 /bfd/opncls.c
parentb6d68b65a7a23b37aa837375f78bc1f277d3145e (diff)
downloadgdb-22e899a32602e789e1066fc677111d9a207cc0bb.tar.gz
* opncls.c (bfd_fopen): Don't set bfd_error unconditionally.
Diffstat (limited to 'bfd/opncls.c')
-rw-r--r--bfd/opncls.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/bfd/opncls.c b/bfd/opncls.c
index 74bee5777ae..112401aee54 100644
--- a/bfd/opncls.c
+++ b/bfd/opncls.c
@@ -155,8 +155,6 @@ bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
bfd *nbfd;
const bfd_target *target_vec;
- bfd_set_error (bfd_error_system_call);
-
nbfd = _bfd_new_bfd ();
if (nbfd == NULL)
return NULL;
@@ -176,6 +174,7 @@ bfd_fopen (const char *filename, const char *target, const char *mode, int fd)
nbfd->iostream = fopen (filename, mode);
if (nbfd->iostream == NULL)
{
+ bfd_set_error (bfd_error_system_call);
_bfd_delete_bfd (nbfd);
return NULL;
}