From: Alan Modra Date: Wed, 8 Jun 2005 03:16:48 +0000 (+0000) Subject: * opncls.c (bfd_fopen): Don't set bfd_error unconditionally. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=92a7c1b8ba9db048564ed12b55d2e9ef78e7e53b;p=binutils-gdb.git * opncls.c (bfd_fopen): Don't set bfd_error unconditionally. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 23a15efd0b0..6b8388f6c74 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 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; }