This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA:] ar test failure fix


On Wed, Jun 08, 2005 at 05:01:57AM +0200, Hans-Peter Nilsson wrote:
> My patch is for bfd_fopen which only did that on error, not bfd_fdopenr.
> 
> So there *is* a latent bug.

Well, there was.  I'm applying this fix instead of yours.

	* opncls.c (bfd_fopen): Don't set bfd_error unconditionally.

Index: bfd/opncls.c
===================================================================
RCS file: /cvs/src/src/bfd/opncls.c,v
retrieving revision 1.35
diff -u -p -r1.35 opncls.c
--- bfd/opncls.c	8 Jun 2005 00:00:05 -0000	1.35
+++ bfd/opncls.c	8 Jun 2005 03:13:43 -0000
@@ -155,8 +155,6 @@ bfd_fopen (const char *filename, const c
   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 c
     nbfd->iostream = fopen (filename, mode);
   if (nbfd->iostream == NULL)
     {
+      bfd_set_error (bfd_error_system_call);
       _bfd_delete_bfd (nbfd);
       return NULL;
     }

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]