From c3b19b439c4c724552dbaa7dd3e7ef829a401494 Mon Sep 17 00:00:00 2001 From: amodra Date: Wed, 8 Jun 2005 03:16:47 +0000 Subject: [PATCH] * opncls.c (bfd_fopen): Don't set bfd_error unconditionally. --- bfd/ChangeLog | 4 ++++ bfd/opncls.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 23a15efd0b..6b8388f6c7 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,7 @@ +2005-06-08 Alan Modra + + * opncls.c (bfd_fopen): Don't set bfd_error unconditionally. + 2005-06-07 Mark Mitchell * opncls.c (bfd_fdopenr): Add missing break statements. diff --git a/bfd/opncls.c b/bfd/opncls.c index 74bee5777a..112401aee5 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; } -- 2.11.0