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:26:37AM +0200, Hans-Peter Nilsson wrote:
> > Date: Wed, 8 Jun 2005 05:20:08 +0200
> > From: Hans-Peter Nilsson <hp@axis.com>
> 
> > > 	* opncls.c (bfd_fopen): Don't set bfd_error unconditionally.
> > 
> > But not the same in bfd_fdopenr?

Huh, for some reason I thought Mark had removed the bfd_set_error call.
I looked at that function and my eyes skipped right over it.  We want
this:

Index: bfd/opncls.c
===================================================================
RCS file: /cvs/src/src/bfd/opncls.c,v
retrieving revision 1.36
diff -u -p -r1.36 opncls.c
--- bfd/opncls.c	8 Jun 2005 03:16:48 -0000	1.36
+++ bfd/opncls.c	8 Jun 2005 03:47:53 -0000
@@ -268,13 +268,15 @@ bfd_fdopenr (const char *filename, const
   int fdflags;
 #endif
 
-  bfd_set_error (bfd_error_system_call);
 #if ! defined(HAVE_FCNTL) || ! defined(F_GETFL)
   mode = FOPEN_RUB; /* Assume full access.  */
 #else
   fdflags = fcntl (fd, F_GETFL, NULL);
   if (fdflags == -1)
-    return NULL;
+    {
+      bfd_set_error (bfd_error_system_call);
+      return NULL;
+    }
 
   /* (O_ACCMODE) parens are to avoid Ultrix header file bug.  */
   switch (fdflags & (O_ACCMODE))


-- 
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]