This is the mail archive of the binutils@sourceware.org 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: objdump infinite loop on v850 object file


On Tue, Oct 05, 2010 at 08:17:18PM +0200, Andreas Schwab wrote:
> Wouldn't that clobber errno if the error is bfd_error_system_call?

Thanks Andreas.  A good thing someone is awake around here.  :-)

	* bucomm.c (bfd_nonfatal, bfd_nonfatal_message): Don't clobber errno.

Index: binutils/bucomm.c
===================================================================
RCS file: /cvs/src/src/binutils/bucomm.c,v
retrieving revision 1.40
diff -u -p -r1.40 bucomm.c
--- binutils/bucomm.c	5 Oct 2010 05:48:10 -0000	1.40
+++ binutils/bucomm.c	5 Oct 2010 22:46:21 -0000
@@ -54,8 +54,8 @@ bfd_nonfatal (const char *string)
 {
   const char *errmsg;
 
-  fflush (stdout);
   errmsg = bfd_errmsg (bfd_get_error ());
+  fflush (stdout);
   if (string)
     fprintf (stderr, "%s: %s: %s\n", program_name, string, errmsg);
   else
@@ -84,8 +84,8 @@ bfd_nonfatal_message (const char *filena
   const char *section_name;
   va_list args;
 
-  fflush (stdout);
   errmsg = bfd_errmsg (bfd_get_error ());
+  fflush (stdout);
   section_name = NULL;
   va_start (args, format);
   fprintf (stderr, "%s", program_name);

-- 
Alan Modra
Australia Development Lab, IBM


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